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

Handle updates removing remaining finalizers on deleted objects #77952

Merged
merged 1 commit into from May 17, 2019

Conversation

@liggitt
Copy link
Member

commented May 15, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
Avoids making all finalizer implementers do a separate delete after removing their finalizer

Which issue(s) this PR fixes:
Fixes #77944

Does this PR introduce a user-facing change?:

Updates that remove remaining `metadata.finalizers` from  an object that is pending deletion (non-nil metadata.deletionTimestamp) and has no graceful deletion pending (nil or 0 metadata.deletionGracePeriodSeconds) now results in immediate deletion of the object.

/sig api-machinery
/cc @caesarxuchao

@caesarxuchao

This comment has been minimized.

Copy link
Member

commented May 15, 2019

The approach lgtm.

Please add a unit test to ensure the namespace delete behavior is correct.

We need to update namespace controller and crd finalizer logic, these lines should be redundant now:

if d.deleteNamespaceWhenDone && finalized(namespace) {
return d.deleteNamespace(namespace)
}

// and now issue another delete, which should clean it all up if no finalizers remain or no-op if they do
return c.crdClient.CustomResourceDefinitions().Delete(crd.Name, nil)

@liggitt liggitt force-pushed the liggitt:delete-on-update branch from 7461b4a to 402fd13 May 15, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@liggitt liggitt changed the title WIP - Handle updates removing remaining finalizers on deleted objects Handle updates removing remaining finalizers on deleted objects May 15, 2019

@liggitt

This comment has been minimized.

Copy link
Member Author

commented May 15, 2019

Please add a unit test to ensure the namespace delete behavior is correct.

done, added positive and negative unit tests for spec and metadata finalizers on namespace update and finalize storage

We need to update namespace controller and crd finalizer logic, these lines should be redundant now

added TODOs to remove redundant deletes in the next release (I'd rather be extra sure we don't block namespace or CRD cleanup in a controller/apiserver skew scenario)

@liggitt liggitt force-pushed the liggitt:delete-on-update branch from 402fd13 to fba885a May 15, 2019

@liggitt

This comment has been minimized.

Copy link
Member Author

commented May 15, 2019

/retest

@caesarxuchao

This comment has been minimized.

Copy link
Member

commented May 16, 2019

/lgtm

@liggitt

This comment has been minimized.

Copy link
Member Author

commented May 16, 2019

/priority important-soon

@k8s-ci-robot k8s-ci-robot merged commit 2741095 into kubernetes:master May 17, 2019

20 checks passed

cla/linuxfoundation liggitt authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

@liggitt liggitt deleted the liggitt:delete-on-update branch May 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.