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

Allow overriding workflow labels in 'argo submit' #1475

Merged
merged 3 commits into from
Aug 2, 2019
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Merge labels from commandline instead of replacing all. No longer ign…
…ore errors in labels parameter
  • Loading branch information
markterm committed Jul 18, 2019
commit 005baf341e454a33c14df5687e045a5eaaf86a8d
12 changes: 9 additions & 3 deletions workflow/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,18 @@ func SubmitWorkflow(wfIf v1alpha1.WorkflowInterface, wf *wfv1.Workflow, opts *Su
wf.Spec.ServiceAccountName = opts.ServiceAccount
}
labels := wf.GetLabels()
if opts.Labels != "" {
labels, _ = cmdutil.ParseLabels(opts.Labels)
}
if labels == nil {
labels = make(map[string]string)
}
if opts.Labels != "" {
passedLabels, err := cmdutil.ParseLabels(opts.Labels)
if err != nil {
return nil, fmt.Errorf("Expected labels of the form: NAME1=VALUE2,NAME2=VALUE2. Received: %s", opts.Labels)
}
for k, v := range passedLabels {
labels[k] = v
}
}
if opts.InstanceID != "" {
labels[common.LabelKeyControllerInstanceID] = opts.InstanceID
}
Expand Down