Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ordering of functionality for setting and evaluating label expressions #9661

Merged
merged 74 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e703d0b
chore(deps): bump docker/login-action from 1 to 2 (#1)
dependabot[bot] May 9, 2022
559e049
chore(deps): bump docker/setup-buildx-action from 1 to 2 (#3)
dependabot[bot] May 9, 2022
21f02d2
chore(deps): bump docker/setup-qemu-action from 1 to 2 (#4)
dependabot[bot] May 9, 2022
a18d932
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.24 to 7.0.26 …
dependabot[bot] May 9, 2022
f8a26d5
chore(deps): bump google.golang.org/api from 0.75.0 to 0.78.0 (#6)
dependabot[bot] May 9, 2022
baaa822
chore(deps): bump github.com/argoproj/pkg from 0.12.0 to 0.13.2 (#7)
dependabot[bot] May 9, 2022
34255e6
chore(deps): bump google.golang.org/api from 0.78.0 to 0.79.0 (#8)
dependabot[bot] May 10, 2022
a66ff32
chore(deps): bump github.com/coreos/go-oidc/v3 from 3.1.0 to 3.2.0 (#9)
dependabot[bot] May 11, 2022
a7dc5d3
chore(deps): bump github.com/aliyun/aliyun-oss-go-sdk (#10)
dependabot[bot] May 13, 2022
d83da66
chore(deps): bump github.com/prometheus/client_golang (#11)
dependabot[bot] May 13, 2022
25e6d08
chore(deps): bump google.golang.org/api from 0.79.0 to 0.80.0 (#12)
dependabot[bot] May 17, 2022
77d1d99
chore(deps): bump cloud.google.com/go/storage from 1.22.0 to 1.22.1 (…
dependabot[bot] May 19, 2022
2b45c8f
chore(deps): bump google.golang.org/api from 0.80.0 to 0.81.0 (#14)
dependabot[bot] May 24, 2022
d77801d
chore(deps): bump github.com/aliyun/aliyun-oss-go-sdk (#15)
dependabot[bot] May 25, 2022
93735ed
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.26 to 7.0.27 …
dependabot[bot] May 26, 2022
755e7ce
chore(deps): bump github.com/spf13/viper from 1.11.0 to 1.12.0 (#17)
dependabot[bot] May 26, 2022
d3c2b07
chore(deps): bump google.golang.org/api from 0.81.0 to 0.82.0 (#18)
dependabot[bot] Jun 2, 2022
f4560b2
chore(deps): bump google.golang.org/api from 0.82.0 to 0.83.0 (#19)
dependabot[bot] Jun 7, 2022
cf48825
chore(deps): bump github.com/stretchr/testify from 1.7.1 to 1.7.2 (#20)
dependabot[bot] Jun 7, 2022
0a56094
chore(deps): bump actions/setup-python from 3 to 4 (#21)
dependabot[bot] Jun 8, 2022
bc897f2
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.27 to 7.0.28 …
dependabot[bot] Jun 13, 2022
8b119db
chore(deps): bump google.golang.org/api from 0.83.0 to 0.84.0 (#23)
dependabot[bot] Jun 14, 2022
f271e36
chore(deps): bump github.com/argoproj/pkg from 0.13.2 to 0.13.3 (#24)
dependabot[bot] Jun 17, 2022
f95fb4c
chore(deps): bump github.com/prometheus/common from 0.34.0 to 0.35.0 …
dependabot[bot] Jun 20, 2022
1bc3dc1
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.28 to 7.0.29 …
dependabot[bot] Jun 20, 2022
51a03f1
chore(deps): bump google.golang.org/api from 0.84.0 to 0.85.0 (#27)
dependabot[bot] Jun 21, 2022
4996c01
chore(deps): bump github.com/stretchr/testify from 1.7.2 to 1.7.4 (#29)
dependabot[bot] Jun 23, 2022
7d8e6d2
chore(deps): bump github.com/argoproj/pkg from 0.13.3 to 0.13.6 (#30)
dependabot[bot] Jun 23, 2022
5996ff7
chore(deps): bump cloud.google.com/go/storage from 1.22.1 to 1.23.0 (…
dependabot[bot] Jun 23, 2022
e6f88aa
chore(deps): bump github.com/stretchr/testify from 1.7.4 to 1.7.5 (#32)
dependabot[bot] Jun 24, 2022
d4fbeac
chore(deps): bump google.golang.org/api from 0.85.0 to 0.86.0 (#33)
dependabot[bot] Jun 28, 2022
0e1b600
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.29 to 7.0.30 …
dependabot[bot] Jun 28, 2022
b095170
chore(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0 (#36)
dependabot[bot] Jun 30, 2022
bd66a3a
chore(deps): bump dependabot/fetch-metadata from 1.3.1 to 1.3.3 (#37)
dependabot[bot] Jul 1, 2022
483ecff
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.30 to 7.0.31 …
dependabot[bot] Jul 6, 2022
74a07d8
chore(deps): bump github.com/prometheus/common from 0.35.0 to 0.36.0 …
dependabot[bot] Jul 11, 2022
526e14b
chore(deps): bump google.golang.org/api from 0.86.0 to 0.87.0 (#40)
dependabot[bot] Jul 12, 2022
e84003a
chore(deps): bump github.com/prometheus/common from 0.36.0 to 0.37.0 …
dependabot[bot] Jul 14, 2022
9a6edfb
chore(deps): bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0 (#42)
dependabot[bot] Jul 19, 2022
56b7dc0
chore(deps): bump google.golang.org/api from 0.87.0 to 0.88.0 (#43)
dependabot[bot] Jul 20, 2022
a47fe88
chore(deps): bump cloud.google.com/go/storage from 1.23.0 to 1.24.0 (…
dependabot[bot] Jul 20, 2022
1869eee
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.31 to 7.0.32 …
dependabot[bot] Jul 25, 2022
a4d7b5d
chore(deps): bump google.golang.org/api from 0.88.0 to 0.89.0 (#46)
dependabot[bot] Jul 26, 2022
5424bd0
chore(deps): bump google.golang.org/api from 0.89.0 to 0.90.0 (#47)
dependabot[bot] Jul 29, 2022
bc524b4
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.32 to 7.0.33 …
dependabot[bot] Aug 1, 2022
76195aa
chore(deps): bump google.golang.org/api from 0.90.0 to 0.91.0 (#49)
dependabot[bot] Aug 3, 2022
12f51c1
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.33 to 7.0.34 …
dependabot[bot] Aug 3, 2022
f5e68a1
chore(deps): bump github.com/tidwall/gjson from 1.14.1 to 1.14.2 (#51)
dependabot[bot] Aug 5, 2022
f1ca8b3
chore(deps): bump github.com/prometheus/client_golang (#52)
dependabot[bot] Aug 8, 2022
c3b2276
chore(deps): bump google.golang.org/api from 0.91.0 to 0.92.0 (#53)
dependabot[bot] Aug 10, 2022
4f72f89
chore(deps): bump cloud.google.com/go/storage from 1.24.0 to 1.25.0 (…
dependabot[bot] Aug 11, 2022
0bbfd78
chore(deps): bump google.golang.org/api from 0.92.0 to 0.93.0 (#55)
dependabot[bot] Aug 16, 2022
680b877
chore(deps): bump github.com/argoproj-labs/argo-dataflow (#56)
dependabot[bot] Aug 16, 2022
d397eaf
chore(deps): bump github.com/tidwall/gjson from 1.14.2 to 1.14.3 (#57)
dependabot[bot] Aug 18, 2022
3b88b6f
chore(deps): bump github.com/aliyun/aliyun-oss-go-sdk (#58)
dependabot[bot] Aug 22, 2022
7a19a66
chore(deps): bump google.golang.org/api from 0.93.0 to 0.94.0 (#59)
dependabot[bot] Aug 23, 2022
6cfdc26
chore(deps): bump cloud.google.com/go/storage from 1.25.0 to 1.26.0 (…
dependabot[bot] Aug 29, 2022
88f2e1a
chore: put latest master of workflows onto my fork
juliev0 Sep 2, 2022
0cbcbfa
chore: update my fork with latest master
juliev0 Sep 22, 2022
e4d64d3
fix: breaking updateWorkflowMetadata() into two functions
juliev0 Sep 22, 2022
442fa8e
fix: separate the update of workflowMetadata global-params from the s…
juliev0 Sep 22, 2022
f5262ad
fix: move the code around a bit
juliev0 Sep 22, 2022
f014371
fix: reorder evaluation of labelsFrom
juliev0 Sep 23, 2022
88aa08e
fix: evaluate LabelsFrom
juliev0 Sep 23, 2022
6acfb31
fix: don't think we need to do substitution of templates here
juliev0 Sep 23, 2022
1a899b5
fix: empty commit
juliev0 Sep 23, 2022
9e86014
fix: adding unit test
juliev0 Sep 24, 2022
ae60c6a
chore: comments
juliev0 Sep 24, 2022
f307d2f
fix: empty commit
juliev0 Sep 24, 2022
a65b472
chore: restore generation of Labels/Annotations maps
juliev0 Sep 24, 2022
59d26d0
chore: comment
juliev0 Sep 24, 2022
824cb30
fix: should update globalParams too
juliev0 Sep 24, 2022
a7ea1a8
fix: typo
juliev0 Sep 27, 2022
cb34ce2
fix: empty commit
juliev0 Sep 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 65 additions & 16 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,22 +482,30 @@ func (woc *wfOperationCtx) operate(ctx context.Context) {
}
}

// set Labels and Annotations for the Workflow
// Also, since we're setting Labels and Annotations we need to find any
// parameters formatted as "workflow.labels.<param>" or "workflow.annotations.<param>"
// and perform substitution
func (woc *wfOperationCtx) updateWorkflowMetadata() error {
updatedParams := make(common.Parameters)
if md := woc.execWf.Spec.WorkflowMetadata; md != nil {
if woc.wf.ObjectMeta.Labels == nil {
woc.wf.ObjectMeta.Labels = make(map[string]string)
if woc.wf.Labels == nil {
woc.wf.Labels = make(map[string]string)
}
for n, v := range md.Labels {
woc.wf.Labels[n] = v
woc.globalParams["workflow.labels."+n] = v
updatedParams["workflow.labels."+n] = v
}
if woc.wf.ObjectMeta.Annotations == nil {
woc.wf.ObjectMeta.Annotations = make(map[string]string)
if woc.wf.Annotations == nil {
woc.wf.Annotations = make(map[string]string)
}
for n, v := range md.Annotations {
woc.wf.Annotations[n] = v
woc.globalParams["workflow.annotations."+n] = v
woc.globalParams["workflow.labels."+n] = v
juliev0 marked this conversation as resolved.
Show resolved Hide resolved
updatedParams["workflow.annotations."+n] = v
}

env := env.GetFuncMap(template.EnvMap(woc.globalParams))
for n, f := range md.LabelsFrom {
r, err := expr.Eval(f.Expression, env)
Expand All @@ -510,8 +518,16 @@ func (woc *wfOperationCtx) updateWorkflowMetadata() error {
}
woc.wf.Labels[n] = v
woc.globalParams["workflow.labels."+n] = v
updatedParams["workflow.labels."+n] = v
}
woc.updated = true

// Now we need to do any substitution that involves these labels
err := woc.substituteGlobalVariables(updatedParams)
if err != nil {
return err
}

}
return nil
}
Expand Down Expand Up @@ -570,6 +586,23 @@ func (woc *wfOperationCtx) setGlobalParameters(executionParameters wfv1.Argument
woc.globalParams["workflow.parameters."+param.Name] = param.Value.String()
}
}
if woc.wf.Status.Outputs != nil {
for _, param := range woc.wf.Status.Outputs.Parameters {
if param.HasValue() {
woc.globalParams["workflow.outputs.parameters."+param.Name] = param.GetValue()
}
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this isn't new code - just relocated

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Set global parameters based on Labels and Annotations, both those that are defined in the execWf.ObjectMeta
// and those that are defined in the execWf.Spec.WorkflowMetadata
// Note: we no longer set globalParams based on LabelsFrom expressions here since they may themselves use parameters
// and thus will need to be evaluated later based on the evaluation of those parameters
/////////////////////////////////////////////////////////////////////////////////////////////////////////////

md := woc.execWf.Spec.WorkflowMetadata

if workflowAnnotations, err := json.Marshal(woc.wf.ObjectMeta.Annotations); err == nil {
woc.globalParams[common.GlobalVarWorkflowAnnotations] = string(workflowAnnotations)
}
Expand All @@ -580,15 +613,30 @@ func (woc *wfOperationCtx) setGlobalParameters(executionParameters wfv1.Argument
woc.globalParams[common.GlobalVarWorkflowLabels] = string(workflowLabels)
}
for k, v := range woc.wf.ObjectMeta.Labels {
woc.globalParams["workflow.labels."+k] = v
// if the Label will get overridden by a LabelsFrom expression later, don't set it now
if md != nil {
_, existsLabelsFrom := md.LabelsFrom[k]
if !existsLabelsFrom {
woc.globalParams["workflow.labels."+k] = v
}
} else {
woc.globalParams["workflow.labels."+k] = v
}
}
if woc.wf.Status.Outputs != nil {
for _, param := range woc.wf.Status.Outputs.Parameters {
if param.HasValue() {
woc.globalParams["workflow.outputs.parameters."+param.Name] = param.GetValue()

if md != nil {
for n, v := range md.Labels {
// if the Label will get overridden by a LabelsFrom expression later, don't set it now
_, existsLabelsFrom := md.LabelsFrom[n]
if !existsLabelsFrom {
woc.globalParams["workflow.labels."+n] = v
}
}
for n, v := range md.Annotations {
woc.globalParams["workflow.annotations."+n] = v
}
}

return nil
}

Expand Down Expand Up @@ -3532,16 +3580,17 @@ func (woc *wfOperationCtx) setExecWorkflow(ctx context.Context) error {
woc.markWorkflowFailed(ctx, fmt.Sprintf("failed to set global parameters: %s", err.Error()))
return err
}

err = woc.substituteGlobalVariables(woc.globalParams)
if err != nil {
return err
}
if woc.wf.Status.Phase == wfv1.WorkflowUnknown {
if err := woc.updateWorkflowMetadata(); err != nil {
woc.markWorkflowError(ctx, err)
return err
}
}
err = woc.substituteGlobalVariables()
if err != nil {
return err
}

// runtime value will be set after the substitution, otherwise will not be reflected from stored wf spec
woc.setGlobalRuntimeParameters()
Expand Down Expand Up @@ -3647,7 +3696,7 @@ func (woc *wfOperationCtx) mergedTemplateDefaultsInto(originalTmpl *wfv1.Templat
return nil
}

func (woc *wfOperationCtx) substituteGlobalVariables() error {
func (woc *wfOperationCtx) substituteGlobalVariables(params common.Parameters) error {
execWfSpec := woc.execWf.Spec

// To Avoid the stale Global parameter value substitution to templates.
Expand All @@ -3659,7 +3708,7 @@ func (woc *wfOperationCtx) substituteGlobalVariables() error {
return err
}

resolveSpec, err := template.Replace(string(wfSpec), woc.globalParams, true)
resolveSpec, err := template.Replace(string(wfSpec), params, true)
if err != nil {
return err
}
Expand Down
16 changes: 12 additions & 4 deletions workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3780,7 +3780,7 @@ func TestNestedOptionalOutputArtifacts(t *testing.T) {
assert.Equal(t, wfv1.WorkflowSucceeded, woc.wf.Status.Phase)
}

// TestPodSpecLogForFailedPods tests PodSpec logging configuration
// TestPodSpecLogForFailedPods tests PodSpec logging configuration
func TestPodSpecLogForFailedPods(t *testing.T) {
wf := wfv1.MustUnmarshalWorkflow(helloWorldWf)
cancel, controller := newController(wf)
Expand All @@ -3798,7 +3798,7 @@ func TestPodSpecLogForFailedPods(t *testing.T) {
}
}

// TestPodSpecLogForAllPods tests PodSpec logging configuration
// TestPodSpecLogForAllPods tests PodSpec logging configuration
func TestPodSpecLogForAllPods(t *testing.T) {
cancel, controller := newController()
defer cancel()
Expand Down Expand Up @@ -7067,8 +7067,8 @@ func TestSubstituteGlobalVariablesLabelsAnnotations(t *testing.T) {
// entire template referenced; value not contained in WorkflowTemplate or Workflow
workflow: "@testdata/workflow-sub-test-1.yaml",
workflowTemplate: "@testdata/workflow-template-sub-test-1.yaml",
expectedMutexName: "{{workflow.labels.mutex-name}}",
expectedSchedulerName: "{{workflow.annotations.scheduler-name}}",
expectedMutexName: "{{workflow.labels.mutexName}}",
expectedSchedulerName: "{{workflow.annotations.schedulerName}}",
},
{
// entire template referenced; value is in Workflow.Labels
Expand Down Expand Up @@ -7106,6 +7106,14 @@ func TestSubstituteGlobalVariablesLabelsAnnotations(t *testing.T) {
expectedMutexName: "myMutex",
expectedSchedulerName: "myScheduler",
},
{
// this checks that we can use a sprig expression to set a label (using workflowMetadata.labelsFrom)
// and the result of that label can also be evaluated in the spec
workflow: "@testdata/workflow-sub-test-6.yaml",
workflowTemplate: "@testdata/workflow-template-sub-test-2.yaml",
expectedMutexName: "wfMetadataScheduler",
expectedSchedulerName: "wfMetadataScheduler",
},
}

for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions workflow/controller/testdata/workflow-sub-test-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
name: workflow-template-submittable
synchronization:
mutex:
name: "{{workflow.labels.mutex-name}}"
schedulerName: "{{workflow.annotations.scheduler-name}}"
name: "{{workflow.labels.mutexName}}"
schedulerName: "{{workflow.annotations.schedulerName}}"
8 changes: 4 additions & 4 deletions workflow/controller/testdata/workflow-sub-test-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ metadata:
generateName: workflow-template-hello-world-
namespace: test
labels:
mutex-name: myMutex
mutexName: myMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
workflowTemplateRef:
name: workflow-template-submittable
synchronization:
mutex:
name: "{{workflow.labels.mutex-name}}"
schedulerName: "{{workflow.annotations.scheduler-name}}"
name: "{{workflow.labels.mutexName}}"
schedulerName: "{{workflow.annotations.schedulerName}}"
12 changes: 6 additions & 6 deletions workflow/controller/testdata/workflow-sub-test-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ metadata:
generateName: workflow-template-hello-world-
namespace: test
labels:
mutex-name: myMutex
mutexName: myMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
workflowTemplateRef:
name: workflow-template-submittable
synchronization:
mutex:
name: "{{workflow.labels.mutex-name}}"
schedulerName: "{{workflow.annotations.scheduler-name}}"
name: "{{workflow.labels.mutexName}}"
schedulerName: "{{workflow.annotations.schedulerName}}"
workflowMetadata:
labels:
mutex-name: wfMetadataMutex
mutexName: wfMetadataMutex
annotations:
scheduler-name: wfMetadataScheduler
schedulerName: wfMetadataScheduler
12 changes: 6 additions & 6 deletions workflow/controller/testdata/workflow-sub-test-4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: workflow-template-hello-world-
namespace: test
namespace: argo
labels:
mutex-name: myMutex
mutexName: myOverrideMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
workflowTemplateRef:
name: workflow-template-submittable
synchronization:
mutex:
name: "{{workflow.labels.mutex-name}}"
schedulerName: "{{workflow.annotations.scheduler-name}}"
name: "{{workflow.labels.mutexName}}"
schedulerName: "{{workflow.annotations.schedulerName}}"
workflowMetadata:
annotations:
scheduler-name: wfMetadataScheduler
schedulerName: wfMetadataScheduler
8 changes: 4 additions & 4 deletions workflow/controller/testdata/workflow-sub-test-5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
generateName: workflow-template-hello-world-
namespace: test
labels:
mutex-name: myMutex
mutexName: myMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
entrypoint: myTemplate
templates:
Expand All @@ -18,5 +18,5 @@ spec:
template: whalesay-template
synchronization:
mutex:
name: "{{workflow.labels.mutex-name}}"
schedulerName: "{{workflow.annotations.scheduler-name}}"
name: "{{workflow.labels.mutexName}}"
schedulerName: "{{workflow.annotations.schedulerName}}"
22 changes: 22 additions & 0 deletions workflow/controller/testdata/workflow-sub-test-6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: workflow-template-hello-world-
namespace: test
labels:
mutexName: myMutex
annotations:
schedulerName: myScheduler
spec:
workflowTemplateRef:
name: workflow-template-submittable
synchronization:
mutex:
name: "{{workflow.labels.mutexName}}"
schedulerName: "{{workflow.annotations.schedulerName}}"
workflowMetadata:
labelsFrom:
mutexName:
expression: "{{= sprig.quote(sprig.trim( workflow.annotations.schedulerName )) }}"
annotations:
schedulerName: wfMetadataScheduler
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this new test, we verify that:

  1. workflowMetadata.labelsFrom.mutexName.expression (which is based on another parameter) gets evaluated correctly
  2. the result of that label gets incorporated into spec.synchronization.mutex.name

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
name: workflow-template-submittable
namespace: test
labels:
mutex-name: myMutex
mutexName: myMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
entrypoint: whalesay-template
templates:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
name: workflow-template-submittable
namespace: test
labels:
mutex-name: myMutex
mutexName: myMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
entrypoint: whalesay-template
templates:
Expand All @@ -17,6 +17,6 @@ spec:
args: ['hello']
workflowMetadata:
labels:
mutex-name: wfMetadataTemplateMutex
mutexName: wfMetadataTemplateMutex
annotations:
scheduler-name: wfMetadataTemplateScheduler
schedulerName: wfMetadataTemplateScheduler
10 changes: 5 additions & 5 deletions workflow/controller/testdata/workflow-template-sub-test-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: workflow-template-submittable
namespace: test
namespace: argo
labels:
mutex-name: myMutex
mutexName: myMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
arguments:
parameters:
Expand All @@ -21,7 +21,7 @@ spec:
args: ['hello']
workflowMetadata:
labelsFrom:
mutex-name:
mutexName:
expression: workflow.parameters.mutex
annotations:
scheduler-name: wfMetadataTemplateScheduler
schedulerName: wfMetadataTemplateScheduler
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
name: workflow-template-submittable
namespace: test
labels:
mutex-name: myMutex
mutexName: myMutex
annotations:
scheduler-name: myScheduler
schedulerName: myScheduler
spec:
templates:
- name: whalesay-template
Expand All @@ -16,6 +16,6 @@ spec:
args: ['hello']
workflowMetadata:
labels:
mutex-name: wfMetadataTemplateMutex
mutexName: wfMetadataTemplateMutex
annotations:
scheduler-name: wfMetadataTemplateScheduler
schedulerName: wfMetadataTemplateScheduler