Skip to content

Commit

Permalink
Merge pull request #953 from Vafilor/fix/workflow.volumes
Browse files Browse the repository at this point in the history
fix: workflow volumes don't delete on failed workflow
  • Loading branch information
rushtehrani committed Sep 8, 2021
2 parents 8eeb90d + fc9669d commit c922b70
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/workflow_execution.go
Expand Up @@ -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,
Expand Down

0 comments on commit c922b70

Please sign in to comment.