Skip to content

Commit

Permalink
fix(server): respect workflowDefaults when validating workflows. Fixes
Browse files Browse the repository at this point in the history
…#10946

Submitting a workflow with a variable reference that points to a label
or annotation that comes from `workflowDefaults` will always fail with
an error like the following:
```
msg="Failed to submit workflow: rpc error: code = InvalidArgument desc = templates.whalesay-template: failed to resolve {{workflow.labels.arg-name}}
```

This is happening because the workflow is merged with `workflowDefaults`
at runtime by
https://github.com/argoproj/argo-workflows/blob/2dac1266b446d059ac6df78afe3d09a6ddb3af4b/workflow/controller/controller.go#L1375

which happens before the workflow is validated by `ValidateWorkflow()`.
Therefore, we need to explicitly pass in the `workflowDefaults` (if any)
to `ValidateWorkflow()` so it can merge in any labels/annotations before
validating templates.

Signed-off-by: Mason Malone <[email protected]>
  • Loading branch information
MasonM committed Sep 21, 2024
1 parent 2dac126 commit d01a838
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 59 deletions.
2 changes: 1 addition & 1 deletion pkg/apiclient/argo-kube-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func newArgoKubeClient(ctx context.Context, clientConfig clientcmd.ClientConfig,
func (a *argoKubeClient) NewWorkflowServiceClient() workflowpkg.WorkflowServiceClient {
wfArchive := sqldb.NullWorkflowArchive
wfLister := store.NewKubeLister(a.wfClient)
return &errorTranslatingWorkflowServiceClient{&argoKubeWorkflowServiceClient{workflowserver.NewWorkflowServer(a.instanceIDService, argoKubeOffloadNodeStatusRepo, wfArchive, a.wfClient, wfLister, nil, nil)}}
return &errorTranslatingWorkflowServiceClient{&argoKubeWorkflowServiceClient{workflowserver.NewWorkflowServer(a.instanceIDService, argoKubeOffloadNodeStatusRepo, wfArchive, a.wfClient, wfLister, nil, nil, nil)}}
}

func (a *argoKubeClient) NewCronWorkflowServiceClient() (cronworkflow.CronWorkflowServiceClient, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (o OfflineClusterWorkflowTemplateServiceClient) DeleteClusterWorkflowTempla
}

func (o OfflineClusterWorkflowTemplateServiceClient) LintClusterWorkflowTemplate(ctx context.Context, req *clusterworkflowtmplpkg.ClusterWorkflowTemplateLintRequest, opts ...grpc.CallOption) (*v1alpha1.ClusterWorkflowTemplate, error) {
err := validate.ValidateClusterWorkflowTemplate(nil, o.clusterWorkflowTemplateGetter, req.Template, validate.ValidateOpts{Lint: true})
err := validate.ValidateClusterWorkflowTemplate(nil, o.clusterWorkflowTemplateGetter, req.Template, nil, validate.ValidateOpts{Lint: true})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiclient/offline-cron-workflow-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type OfflineCronWorkflowServiceClient struct {
var _ cronworkflow.CronWorkflowServiceClient = &OfflineCronWorkflowServiceClient{}

func (o OfflineCronWorkflowServiceClient) LintCronWorkflow(ctx context.Context, req *cronworkflow.LintCronWorkflowRequest, _ ...grpc.CallOption) (*v1alpha1.CronWorkflow, error) {
err := validate.ValidateCronWorkflow(o.namespacedWorkflowTemplateGetterMap.GetNamespaceGetter(req.Namespace), o.clusterWorkflowTemplateGetter, req.CronWorkflow)
err := validate.ValidateCronWorkflow(o.namespacedWorkflowTemplateGetterMap.GetNamespaceGetter(req.Namespace), o.clusterWorkflowTemplateGetter, req.CronWorkflow, nil)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiclient/offline-workflow-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (o OfflineWorkflowServiceClient) SetWorkflow(context.Context, *workflowpkg.
}

func (o OfflineWorkflowServiceClient) LintWorkflow(_ context.Context, req *workflowpkg.WorkflowLintRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
err := validate.ValidateWorkflow(o.namespacedWorkflowTemplateGetterMap.GetNamespaceGetter(req.Namespace), o.clusterWorkflowTemplateGetter, req.Workflow, validate.ValidateOpts{Lint: true})
err := validate.ValidateWorkflow(o.namespacedWorkflowTemplateGetterMap.GetNamespaceGetter(req.Namespace), o.clusterWorkflowTemplateGetter, req.Workflow, nil, validate.ValidateOpts{Lint: true})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiclient/offline-workflow-template-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (o OfflineWorkflowTemplateServiceClient) DeleteWorkflowTemplate(ctx context
}

func (o OfflineWorkflowTemplateServiceClient) LintWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateLintRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {
err := validate.ValidateWorkflowTemplate(o.namespacedWorkflowTemplateGetterMap.GetNamespaceGetter(req.Namespace), o.clusterWorkflowTemplateGetter, req.Template, validate.ValidateOpts{Lint: true})
err := validate.ValidateWorkflowTemplate(o.namespacedWorkflowTemplateGetterMap.GetNamespaceGetter(req.Namespace), o.clusterWorkflowTemplateGetter, req.Template, nil, validate.ValidateOpts{Lint: true})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion server/apiserver/argoserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (as *argoServer) Run(ctx context.Context, port int, browserOpenFunc func(st
log.Fatal(err)
}
resourceCacheNamespace := getResourceCacheNamespace(as.managedNamespace)
workflowServer := workflow.NewWorkflowServer(instanceIDService, offloadRepo, wfArchive, as.clients.Workflow, wfStore, wfStore, &resourceCacheNamespace)
workflowServer := workflow.NewWorkflowServer(instanceIDService, offloadRepo, wfArchive, as.clients.Workflow, wfStore, wfStore, config.WorkflowDefaults, &resourceCacheNamespace)
grpcServer := as.newGRPCServer(instanceIDService, workflowServer, wfArchiveServer, eventServer, config.Links, config.Columns, config.NavColor)
httpServer := as.newHTTPServer(ctx, port, artifactServer)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con
cwts.instanceIDService.Label(req.Template)
creator.Label(ctx, req.Template)
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())
err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template, validate.ValidateOpts{})
err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template, nil, validate.ValidateOpts{})
if err != nil {
return nil, serverutils.ToStatusError(err, codes.InvalidArgument)
}
Expand Down Expand Up @@ -104,7 +104,7 @@ func (cwts *ClusterWorkflowTemplateServer) LintClusterWorkflowTemplate(ctx conte
wfClient := auth.GetWfClient(ctx)
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())

err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template, validate.ValidateOpts{Lint: true})
err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template, nil, validate.ValidateOpts{Lint: true})
if err != nil {
return nil, serverutils.ToStatusError(err, codes.InvalidArgument)
}
Expand All @@ -123,7 +123,7 @@ func (cwts *ClusterWorkflowTemplateServer) UpdateClusterWorkflowTemplate(ctx con
wfClient := auth.GetWfClient(ctx)
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())

err = validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template, validate.ValidateOpts{})
err = validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template, nil, validate.ValidateOpts{})
if err != nil {
return nil, serverutils.ToStatusError(err, codes.InvalidArgument)
}
Expand Down
6 changes: 3 additions & 3 deletions server/cronworkflow/cron_workflow_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (c *cronWorkflowServiceServer) LintCronWorkflow(ctx context.Context, req *c
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())
c.instanceIDService.Label(req.CronWorkflow)
creator.Label(ctx, req.CronWorkflow)
err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow)
err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow, nil)
if err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
Expand Down Expand Up @@ -64,7 +64,7 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req
creator.Label(ctx, req.CronWorkflow)
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())
err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow)
err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow, nil)
if err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
Expand All @@ -91,7 +91,7 @@ func (c *cronWorkflowServiceServer) UpdateCronWorkflow(ctx context.Context, req
}
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())
if err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow); err != nil {
if err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow, nil); err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
crWf, err := auth.GetWfClient(ctx).ArgoprojV1alpha1().CronWorkflows(req.Namespace).Update(ctx, req.CronWorkflow, metav1.UpdateOptions{})
Expand Down
10 changes: 6 additions & 4 deletions server/workflow/workflow_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,20 @@ type workflowServer struct {
wfArchive sqldb.WorkflowArchive
wfLister store.WorkflowLister
wfReflector *cache.Reflector
wfDefaults *wfv1.Workflow
}

var _ workflowpkg.WorkflowServiceServer = &workflowServer{}

// NewWorkflowServer returns a new WorkflowServer
func NewWorkflowServer(instanceIDService instanceid.Service, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive, wfClientSet versioned.Interface, wfLister store.WorkflowLister, wfStore store.WorkflowStore, namespace *string) *workflowServer {
func NewWorkflowServer(instanceIDService instanceid.Service, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive, wfClientSet versioned.Interface, wfLister store.WorkflowLister, wfStore store.WorkflowStore, wfDefaults *wfv1.Workflow, namespace *string) *workflowServer {
ws := &workflowServer{
instanceIDService: instanceIDService,
offloadNodeStatusRepo: offloadNodeStatusRepo,
hydrator: hydrator.New(offloadNodeStatusRepo),
wfArchive: wfArchive,
wfLister: wfLister,
wfDefaults: wfDefaults,
}
if wfStore != nil && namespace != nil {
lw := &cache.ListWatch{
Expand Down Expand Up @@ -105,7 +107,7 @@ func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.Wo
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())

err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, validate.ValidateOpts{})
err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, s.wfDefaults, validate.ValidateOpts{})
if err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
Expand Down Expand Up @@ -664,7 +666,7 @@ func (s *workflowServer) LintWorkflow(ctx context.Context, req *workflowpkg.Work
s.instanceIDService.Label(req.Workflow)
creator.Label(ctx, req.Workflow)

err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, validate.ValidateOpts{Lint: true})
err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, s.wfDefaults, validate.ValidateOpts{Lint: true})
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -776,7 +778,7 @@ func (s *workflowServer) SubmitWorkflow(ctx context.Context, req *workflowpkg.Wo
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())

err = validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, wf, validate.ValidateOpts{Submit: true})
err = validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, wf, s.wfDefaults, validate.ValidateOpts{Submit: true})
if err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
Expand Down
2 changes: 1 addition & 1 deletion server/workflow/workflow_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func getWorkflowServer() (workflowpkg.WorkflowServiceServer, context.Context) {
panic(err)
}
namespaceAll := metav1.NamespaceAll
server := NewWorkflowServer(instanceIdSvc, offloadNodeStatusRepo, archivedRepo, wfClientset, wfStore, wfStore, &namespaceAll)
server := NewWorkflowServer(instanceIdSvc, offloadNodeStatusRepo, archivedRepo, wfClientset, wfStore, wfStore, nil, &namespaceAll)
return server, ctx
}

Expand Down
6 changes: 3 additions & 3 deletions server/workflowtemplate/workflow_template_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r
creator.Label(ctx, req.Template)
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())
err := validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template, validate.ValidateOpts{})
err := validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template, nil, validate.ValidateOpts{})
if err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
Expand Down Expand Up @@ -173,7 +173,7 @@ func (wts *WorkflowTemplateServer) LintWorkflowTemplate(ctx context.Context, req
creator.Label(ctx, req.Template)
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())
err := validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template, validate.ValidateOpts{Lint: true})
err := validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template, nil, validate.ValidateOpts{Lint: true})
if err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
Expand All @@ -191,7 +191,7 @@ func (wts *WorkflowTemplateServer) UpdateWorkflowTemplate(ctx context.Context, r
wfClient := auth.GetWfClient(ctx)
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates())
err = validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template, validate.ValidateOpts{})
err = validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template, nil, validate.ValidateOpts{})
if err != nil {
return nil, sutils.ToStatusError(err, codes.InvalidArgument)
}
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/manifests/mixins/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ data:
activeDeadlineSeconds: 300
podSpecPatch: |
terminationGracePeriodSeconds: 3
workflowMetadata:
labels:
default-label: thisLabelIsFromWorkflowDefaults
executor: |
imagePullPolicy: IfNotPresent
resources:
Expand Down
1 change: 1 addition & 0 deletions test/e2e/testdata/workflow-template-sub-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
args:
- echo
- '{{workflow.labels.arg-name}}'
- '{{workflow.labels.default-label}}'
workflowMetadata:
labels:
arg-name: myLabelArg
12 changes: 10 additions & 2 deletions test/e2e/workflow_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
"github.com/argoproj/argo-workflows/v3/test/e2e/fixtures"
)

Expand Down Expand Up @@ -73,8 +74,15 @@ func (s *WorkflowTemplateSuite) TestSubmitWorkflowTemplateWorkflowMetadataSubsti
SubmitWorkflowsFromWorkflowTemplates().
WaitForWorkflow().
Then().
ExpectWorkflow(func(t *testing.T, metadata *v1.ObjectMeta, status *v1alpha1.WorkflowStatus) {
assert.Equal(t, v1alpha1.WorkflowSucceeded, status.Phase)
ExpectWorkflowNode(wfv1.SucceededPodNode, func(t *testing.T, n *wfv1.NodeStatus, p *apiv1.Pod) {
for _, c := range p.Spec.Containers {
if c.Name == "main" {
assert.Len(t, c.Args, 3)
assert.Equal(t, "echo", c.Args[0])
assert.Equal(t, "myLabelArg", c.Args[1])
assert.Equal(t, "thisLabelIsFromWorkflowDefaults", c.Args[2])
}
}
})
}

Expand Down
2 changes: 1 addition & 1 deletion workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3931,7 +3931,7 @@ func (woc *wfOperationCtx) setExecWorkflow(ctx context.Context) error {
// Validate the execution wfSpec
err := waitutil.Backoff(retry.DefaultRetry,
func() (bool, error) {
validationErr := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, woc.wf, validateOpts)
validationErr := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, woc.wf, woc.controller.Config.WorkflowDefaults, validateOpts)
if validationErr != nil {
return !errorsutil.IsTransientErr(validationErr), validationErr
}
Expand Down
2 changes: 1 addition & 1 deletion workflow/cron/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (woc *cronWfOperationCtx) run(ctx context.Context, scheduledRuntime time.Ti
func (woc *cronWfOperationCtx) validateCronWorkflow(ctx context.Context) error {
wftmplGetter := informer.NewWorkflowTemplateFromInformerGetter(woc.wftmplInformer, woc.cronWf.ObjectMeta.Namespace)
cwftmplGetter := informer.NewClusterWorkflowTemplateFromInformerGetter(woc.cwftmplInformer)
err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, woc.cronWf)
err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, woc.cronWf, nil)
if err != nil {
woc.reportCronWorkflowError(ctx, v1alpha1.ConditionTypeSpecError, fmt.Sprint(err))
} else {
Expand Down
2 changes: 1 addition & 1 deletion workflow/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func SubmitWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, wfClie
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClientset.ArgoprojV1alpha1().WorkflowTemplates(namespace))
cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClientset.ArgoprojV1alpha1().ClusterWorkflowTemplates())

err = validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, wf, validate.ValidateOpts{Submit: true})
err = validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, wf, nil, validate.ValidateOpts{Submit: true})
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ spec:
container:
image: docker/whalesay
command: [cowsay]
args: ['{{workflow.labels.arg-name}}', '{{workflow.annotations.arg-name}}']
args: ['{{workflow.labels.arg-name}}', '{{workflow.annotations.arg-name}}', '{{workflow.labels.default-label}}']
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
container:
image: docker/whalesay
command: [cowsay]
args: ['{{workflow.labels.arg-name}}', '{{workflow.annotations.arg-name}}', '{{workflow.labels.arg-name-2}}']
args: ['{{workflow.labels.arg-name}}', '{{workflow.annotations.arg-name}}', '{{workflow.labels.arg-name-2}}', '{{workflow.labels.default-label}}']
workflowMetadata:
labels:
arg-name: myLabelArg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ spec:
container:
image: docker/whalesay
command: [cowsay]
args: ['{{workflow.labels.arg-name}}', '{{workflow.annotations.arg-name}}', '{{workflow.labels.arg-name-2}}']
args: ['{{workflow.labels.arg-name}}', '{{workflow.annotations.arg-name}}', '{{workflow.labels.arg-name-2}}', '{{workflow.labels.default-label}}']
Loading

0 comments on commit d01a838

Please sign in to comment.