diff --git a/workflow/controller/workflowpod.go b/workflow/controller/workflowpod.go index c74a29c38185..c4abfbca6dc2 100644 --- a/workflow/controller/workflowpod.go +++ b/workflow/controller/workflowpod.go @@ -428,7 +428,7 @@ func (woc *wfOperationCtx) createWorkflowPod(ctx context.Context, nodeName strin } } if len(c.Command) == 0 { - return nil, fmt.Errorf("when using the emissary executor you must either explicitly specify the command, or list the image's command in the index: https://argoproj.github.io/argo-workflows/workflow-executors/#emissary-emissary") + return nil, fmt.Errorf("container %q in template %q, does not have the command specified: when using the emissary executor you must either explicitly specify the command, or list the image's command in the index: https://argoproj.github.io/argo-workflows/workflow-executors/#emissary-emissary", c.Name, tmpl.Name) } c.Command = append([]string{"/var/run/argo/argoexec", "emissary", "--"}, c.Command...) } diff --git a/workflow/controller/workflowpod_test.go b/workflow/controller/workflowpod_test.go index fd242d7a1408..c38a465143d1 100644 --- a/workflow/controller/workflowpod_test.go +++ b/workflow/controller/workflowpod_test.go @@ -654,8 +654,8 @@ func Test_createWorkflowPod_emissary(t *testing.T) { t.Run("NoCommand", func(t *testing.T) { woc := newWoc() woc.controller.containerRuntimeExecutor = common.ContainerRuntimeExecutorEmissary - _, err := woc.createWorkflowPod(context.Background(), "", []apiv1.Container{{}}, &wfv1.Template{}, &createWorkflowPodOpts{}) - assert.Error(t, err) + _, err := woc.createWorkflowPod(context.Background(), "", []apiv1.Container{{}}, &wfv1.Template{Name: "my-tmpl"}, &createWorkflowPodOpts{}) + assert.EqualError(t, err, "container \"main\" in template \"my-tmpl\", does not have the command specified: when using the emissary executor you must either explicitly specify the command, or list the image's command in the index: https://argoproj.github.io/argo-workflows/workflow-executors/#emissary-emissary") }) t.Run("CommandNoArgs", func(t *testing.T) { woc := newWoc()