diff --git a/pkg/apis/workflow/v1alpha1/workflow_types.go b/pkg/apis/workflow/v1alpha1/workflow_types.go index 76340b563e9c..64c4bf470b02 100644 --- a/pkg/apis/workflow/v1alpha1/workflow_types.go +++ b/pkg/apis/workflow/v1alpha1/workflow_types.go @@ -2923,9 +2923,10 @@ func (tmpl *Template) GetVolumeMounts() []apiv1.VolumeMount { return nil } -// whether or not the template can and will have outputs (i.e. exit code and result) +// HasOutput returns true if the template can and will have outputs (i.e. exit code and result). +// In the case of a plugin, we assume it will have outputs because we cannot know at runtime. func (tmpl *Template) HasOutput() bool { - return tmpl.Container != nil || tmpl.ContainerSet.HasContainerNamed("main") || tmpl.Script != nil || tmpl.Data != nil || tmpl.HTTP != nil + return tmpl.Container != nil || tmpl.ContainerSet.HasContainerNamed("main") || tmpl.Script != nil || tmpl.Data != nil || tmpl.HTTP != nil || tmpl.Plugin != nil } func (t *Template) IsDaemon() bool { diff --git a/pkg/apis/workflow/v1alpha1/workflow_types_test.go b/pkg/apis/workflow/v1alpha1/workflow_types_test.go index d4881edba48c..586f60ed7332 100644 --- a/pkg/apis/workflow/v1alpha1/workflow_types_test.go +++ b/pkg/apis/workflow/v1alpha1/workflow_types_test.go @@ -1309,6 +1309,10 @@ func TestTemplate_HasOutputs(t *testing.T) { x := &Template{Resource: &ResourceTemplate{}} assert.False(t, x.HasOutput()) }) + t.Run("Plugin", func(t *testing.T) { + x := &Template{Plugin: &Plugin{}} + assert.True(t, x.HasOutput()) + }) } func TestTemplate_SaveLogsAsArtifact(t *testing.T) {