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

Change destroy operation to use foreground cascading delete #2379

Merged
merged 1 commit into from
May 9, 2023
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 CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Unreleased

- Change destroy operation to use foreground cascading delete (https://github.com/pulumi/pulumi-kubernetes/pull/2379)

## 3.26.0 (May 1, 2023)

- Do not await during .get or import operations (https://github.com/pulumi/pulumi-kubernetes/pull/2373)
Expand Down
13 changes: 1 addition & 12 deletions provider/pkg/await/await.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,20 +686,9 @@ func deleteResource(
boolFalse := false
// nolint
deleteOpts.OrphanDependents = &boolFalse
} else if version.Compare(cluster.ServerVersion{Major: 1, Minor: 7}) < 0 {
// 1.6.x option. Background delete propagation is broken in k8s v1.6.
} else {
fg := metav1.DeletePropagationForeground
deleteOpts.PropagationPolicy = &fg
} else {
// > 1.7.x. Prior to 1.9.x, the default is to orphan children[1]. Our kubespy experiments
// with 1.9.11 show that the controller will actually _still_ mark these resources with the
// `orphan` finalizer, although it appears to actually do background delete correctly. We
// therefore set it to background manually, just to be safe.
//
// nolint
// [1] https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#setting-the-cascading-deletion-policy
bg := metav1.DeletePropagationBackground
deleteOpts.PropagationPolicy = &bg
}

// Issue deletion request.
Expand Down
Loading