Skip to content

Commit

Permalink
feat: support finalizers in workflowMetadata (#10243)
Browse files Browse the repository at this point in the history
Signed-off-by: jie zhang <zhangjie609610@163.com>
Co-authored-by: jie zhang <zhangjie609610@163.com>
  • Loading branch information
jessonzj and jasonzhng committed Dec 18, 2022
1 parent 6c5b506 commit f4a65b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions workflow/common/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ func toWorkflow(cronWf wfv1.CronWorkflow, objectMeta metav1.ObjectMeta) *wfv1.Wo
wf.Annotations[key] = annotation
}
}

wf.Finalizers = append(wf.Finalizers, cronWf.Spec.WorkflowMetadata.Finalizers...)
}
wf.SetOwnerReferences(append(wf.GetOwnerReferences(), *metav1.NewControllerRef(&cronWf, wfv1.SchemeGroupVersion.WithKind(workflow.CronWorkflowKind))))

Expand Down
4 changes: 4 additions & 0 deletions workflow/common/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
label1: value1
annotations:
annotation2: value2
finalizers:
- finalizer1
workflowSpec:
entrypoint: whalesay
templates:
Expand All @@ -38,6 +40,8 @@ metadata:
annotation2: value2
workflows.argoproj.io/scheduled-time: "2021-02-19T10:29:05-08:00"
creationTimestamp: null
finalizers:
- finalizer1
generateName: hello-world-
labels:
label1: value1
Expand Down

0 comments on commit f4a65b1

Please sign in to comment.