Merge pull request #953 from Vafilor/fix/workflow.volumes

fix: workflow volumes don't delete on failed workflow
This commit is contained in:
Rush Tehrani
2021-09-08 12:57:56 -07:00
committed by GitHub

View File

@@ -929,7 +929,14 @@ func (c *Client) CreateWorkflowExecution(namespace string, workflow *WorkflowExe
return nil, fmt.Errorf("workflow Template contained more than 1 workflow execution")
}
createdWorkflow, err := c.createWorkflow(namespace, workflowTemplate.ID, workflowTemplate.WorkflowTemplateVersionID, &workflows[0], opts, workflow.Labels)
wf := &workflows[0]
if wf.Spec.VolumeClaimGC == nil {
wf.Spec.VolumeClaimGC = &wfv1.VolumeClaimGC{
Strategy: wfv1.VolumeClaimGCOnCompletion,
}
}
createdWorkflow, err := c.createWorkflow(namespace, workflowTemplate.ID, workflowTemplate.WorkflowTemplateVersionID, wf, opts, workflow.Labels)
if err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,