diff --git a/pkg/cmd/run/rerun/rerun.go b/pkg/cmd/run/rerun/rerun.go index e382fd134..0303060b4 100644 --- a/pkg/cmd/run/rerun/rerun.go +++ b/pkg/cmd/run/rerun/rerun.go @@ -50,11 +50,7 @@ func NewCmdRerun(f *cmdutil.Factory, runF func(*RerunOptions) error) *cobra.Comm } if opts.RunID != "" && opts.JobID != "" { - opts.RunID = "" - if opts.IO.CanPrompt() { - cs := opts.IO.ColorScheme() - fmt.Fprintf(opts.IO.ErrOut, "%s both run and job IDs specified; ignoring run ID\n", cs.WarningIcon()) - } + return cmdutil.FlagErrorf("specify only one of or ") } if runF != nil { diff --git a/pkg/cmd/run/rerun/rerun_test.go b/pkg/cmd/run/rerun/rerun_test.go index 094425290..b7bfc1d62 100644 --- a/pkg/cmd/run/rerun/rerun_test.go +++ b/pkg/cmd/run/rerun/rerun_test.go @@ -76,12 +76,10 @@ func TestNewCmdRerun(t *testing.T) { }, }, { - name: "with args job and runID ignores runID", - tty: true, - cli: "1234 --job 5678", - wants: RerunOptions{ - JobID: "5678", - }, + name: "with args jobID and runID fails", + tty: true, + cli: "1234 --job 5678", + wantsErr: true, }, { name: "with arg job with no ID fails",