Added code to pass identifying Workflow labels.

- CronWorkflow will pass these labels into any Workflow Executions that
are created.
- This means those Workflows will show up under the correct Workflow Template
page.
Fixed some code related to argo update.
This commit is contained in:
Aleksandr Melnikov
2020-04-03 16:52:01 -07:00
parent 9ce6e1f1d8
commit b668b54fd6
2 changed files with 3 additions and 2 deletions

View File

@@ -407,6 +407,7 @@ func (c *Client) createCronWorkflow(namespace string, workflowTemplateUid string
// return nil, err
//}
cwf.Spec.WorkflowMetadata = &metav1.ObjectMeta{Labels: *opts.Labels}
createdCronWorkflow, err = c.ArgoprojV1alpha1().CronWorkflows(namespace).Create(cwf)
if err != nil {
return nil, err

View File

@@ -256,7 +256,7 @@ func (c *Client) ValidateWorkflowExecution(namespace string, manifest []byte) (e
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(c.ArgoprojV1alpha1().WorkflowTemplates(namespace))
for _, wf := range workflows {
c.injectAutomatedFields(namespace, &wf, &WorkflowExecutionOptions{})
err = validate.ValidateWorkflow(wftmplGetter, &wf, validate.ValidateOpts{})
_, err = validate.ValidateWorkflow(wftmplGetter, &wf, validate.ValidateOpts{})
if err != nil {
return
}
@@ -726,7 +726,7 @@ func (c *Client) ResubmitWorkflowExecution(namespace, name string) (workflow *Wo
}
func (c *Client) ResumeWorkflowExecution(namespace, name string) (workflow *WorkflowExecution, err error) {
err = argoutil.ResumeWorkflow(c.ArgoprojV1alpha1().Workflows(namespace), name)
err = argoutil.ResumeWorkflow(c.ArgoprojV1alpha1().Workflows(namespace), name, "")
if err != nil {
return
}