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

Enable finalizers independent of GC enablement #51148

Merged

Conversation

ironcladlou
Copy link
Contributor

@ironcladlou ironcladlou commented Aug 22, 2017

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Finalizers are now honored on custom resources, and on other resources even when garbage collection is disabled via the apiserver flag `--enable-garbage-collector=false`

/cc @kubernetes/sig-api-machinery-bugs
/cc @caesarxuchao @liggitt @sttts @pmorie

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes kubernetes#50528.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 22, 2017
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Aug 22, 2017
func (e *Store) shouldDeleteDuringUpdate(ctx genericapirequest.Context, key string, obj, existing runtime.Object) bool {
if !e.EnableGarbageCollection {
return false
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please closely scrutinize this particular change to ensure there aren't some unintended consequences.

//
// Because the finalizers created here are only cleared by the garbage
// collector, deletionFinalizers always returns false when garbage collection is
// disabled for the Store.
func deletionFinalizers(e *Store, accessor metav1.Object, options *metav1.DeleteOptions) (bool, []string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to something like deletionFinalizersForGarbageCollection?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed, and also attempted to make the godocs more clear.

@caesarxuchao caesarxuchao assigned liggitt and caesarxuchao and unassigned wojtek-t and piosz Aug 22, 2017
@ironcladlou
Copy link
Contributor Author

/retest

@deads2k
Copy link
Contributor

deads2k commented Aug 23, 2017

lgtm

Copy link
Member

@caesarxuchao caesarxuchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

} else {
// TODO: remove the check on graceful, because we support no-op updates now.
if graceful {
err, ignoreNotFound, deleteImmediately, out, lastExisting = e.updateForGracefulDeletion(ctx, name, key, options, preconditions, obj)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to keep both functions to be able to turn off all finalizers. The finalizers feature has been stablized long enough to remove the redundant code.

if err != nil {
t.Fatalf("Unexpected error: %v", err)
}
gcStates := []bool{true, false}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you didn't change the tests, you just added the case where gcStates=false, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ignoring white space (add ?w=1) made that clear. The diff was terrifying otherwise

@liggitt
Copy link
Member

liggitt commented Aug 25, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 25, 2017
@liggitt liggitt added this to the v1.7 milestone Aug 25, 2017
@liggitt liggitt added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Aug 25, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, liggitt

Associated issue: 50528

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2017
@liggitt
Copy link
Member

liggitt commented Aug 25, 2017

Please add a release note that finalizers on custom resources are now respected.

Since this also affects external servers building on the generic store in the 1.7 timeframe (like service catalog) that had to disable garbage collection because GC didn't support discovered resources, I think we should pick this change to 1.7.x as well

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 51148, 50816, 49741, 50858, 51223)

@k8s-github-robot k8s-github-robot merged commit 7edab23 into kubernetes:master Aug 25, 2017
@wojtek-t
Copy link
Member

@liggitt @caesarxuchao @ironcladlou - can you please add a user-friendly release note if you want this cherrypicked?

@liggitt
Copy link
Member

liggitt commented Aug 25, 2017

done

@caesarxuchao
Copy link
Member

caesarxuchao commented Aug 25, 2017

@liggitt, could you also add "finalizers are now respected even if the garbage collector is disabled via the apiserver flag --enable-garbage-collector"?

@liggitt
Copy link
Member

liggitt commented Aug 25, 2017

done

@wojtek-t
Copy link
Member

Automated cherrypick is resulting in some conficts. Can one of you please create the cherrypick?

@wojtek-t
Copy link
Member

ironcladlou added a commit to ironcladlou/kubernetes that referenced this pull request Aug 28, 2017
Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes kubernetes#50528.

Backport of kubernetes#51148.
@ironcladlou
Copy link
Contributor Author

1.7 backport PR is #51469

@wojtek-t wojtek-t added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Aug 28, 2017
k8s-github-robot pushed a commit that referenced this pull request Aug 29, 2017
Automatic merge from submit-queue

Enable finalizers independent of GC enablement

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of #51148.

```release-note
Finalizers are now honored on custom resources, and on other resources even when garbage collection is disabled via the apiserver flag `--enable-garbage-collector=false`
```

/cc @kubernetes/sig-api-machinery-bugs 
/cc @caesarxuchao @liggitt @sttts @pmorie
sttts pushed a commit to sttts/apiserver that referenced this pull request Sep 22, 2017
Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

Kubernetes-commit: 6a64a13f5ce573259d1c87ad752c39d9e253053a
sttts pushed a commit to sttts/apiserver that referenced this pull request Sep 22, 2017
Automatic merge from submit-queue

Enable finalizers independent of GC enablement

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

```release-note
Finalizers are now honored on custom resources, and on other resources even when garbage collection is disabled via the apiserver flag `--enable-garbage-collector=false`
```

/cc @kubernetes/sig-api-machinery-bugs
/cc @caesarxuchao @liggitt @sttts @pmorie

Kubernetes-commit: 209ba5d0dccb1cfe087615964f28f497f05e52b0
sttts pushed a commit to sttts/apiserver that referenced this pull request Oct 14, 2017
Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

Kubernetes-commit: 6a64a13f5ce573259d1c87ad752c39d9e253053a
sttts pushed a commit to sttts/apiserver that referenced this pull request Oct 14, 2017
Automatic merge from submit-queue

Enable finalizers independent of GC enablement

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

```release-note
Finalizers are now honored on custom resources, and on other resources even when garbage collection is disabled via the apiserver flag `--enable-garbage-collector=false`
```

/cc @kubernetes/sig-api-machinery-bugs
/cc @caesarxuchao @liggitt @sttts @pmorie

Kubernetes-commit: 209ba5d0dccb1cfe087615964f28f497f05e52b0
sttts pushed a commit to sttts/apiserver that referenced this pull request Oct 16, 2017
Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

Kubernetes-commit: 6a64a13f5ce573259d1c87ad752c39d9e253053a
sttts pushed a commit to sttts/apiserver that referenced this pull request Oct 16, 2017
Automatic merge from submit-queue

Enable finalizers independent of GC enablement

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

```release-note
Finalizers are now honored on custom resources, and on other resources even when garbage collection is disabled via the apiserver flag `--enable-garbage-collector=false`
```

/cc @kubernetes/sig-api-machinery-bugs
/cc @caesarxuchao @liggitt @sttts @pmorie

Kubernetes-commit: 209ba5d0dccb1cfe087615964f28f497f05e52b0
deads2k pushed a commit to openshift/kubernetes-apiserver that referenced this pull request Oct 16, 2017
Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

:100644 100644 2dcea903a0... 2153c16c5b... M	pkg/registry/generic/registry/store.go
:100644 100644 fa61ac97b9... 096517a662... M	pkg/registry/generic/registry/store_test.go
sttts pushed a commit to sttts/apiserver that referenced this pull request Jan 9, 2018
Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

Kubernetes-commit: 6a64a13f5ce573259d1c87ad752c39d9e253053a
sttts pushed a commit to sttts/apiserver that referenced this pull request Jan 9, 2018
Automatic merge from submit-queue

Enable finalizers independent of GC enablement

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

```release-note
Finalizers are now honored on custom resources, and on other resources even when garbage collection is disabled via the apiserver flag `--enable-garbage-collector=false`
```

/cc @kubernetes/sig-api-machinery-bugs
/cc @caesarxuchao @liggitt @sttts @pmorie

Kubernetes-commit: 209ba5d0dccb1cfe087615964f28f497f05e52b0
k8s-publishing-bot pushed a commit to kubernetes/apiserver that referenced this pull request Jan 11, 2018
Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

Kubernetes-commit: 6a64a13f5ce573259d1c87ad752c39d9e253053a
k8s-publishing-bot added a commit to kubernetes/apiserver that referenced this pull request Jan 11, 2018
Automatic merge from submit-queue

Enable finalizers independent of GC enablement

Decouple finalizer processing from garbage collection configuration.
Finalizers should be effective even when garbage collection is disabled
for a given store.

Fixes #50528.

Backport of kubernetes/kubernetes#51148.

```release-note
Finalizers are now honored on custom resources, and on other resources even when garbage collection is disabled via the apiserver flag `--enable-garbage-collector=false`
```

/cc @kubernetes/sig-api-machinery-bugs
/cc @caesarxuchao @liggitt @sttts @pmorie

Kubernetes-commit: 209ba5d0dccb1cfe087615964f28f497f05e52b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants