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

feat: support finalizers in workflowMetadata #10243

Merged
merged 1 commit into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
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