-
Notifications
You must be signed in to change notification settings - Fork 42k
[GarbageCollector] Allow per-resource default garbage collection behavior #30838
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
[GarbageCollector] Allow per-resource default garbage collection behavior #30838
Conversation
| NUM_NODES: $(yaml-quote ${NUM_NODES}) | ||
| STORAGE_BACKEND: $(yaml-quote ${STORAGE_BACKEND:-}) | ||
| ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-false}) | ||
| ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will be removed before merge. Just here to run the e2e tests with GC on.
|
@lavalamp, I only make the RC and RS registry to set OrphanDependents as the default behavior and all tests have passed. |
|
@lavalamp it's ready for review. Thanks. |
|
Review status: 0 of 10 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. cluster/common.sh, line 649 [r1] (raw file):
|
|
Review status: 0 of 10 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. cluster/common.sh, line 649 [r1] (raw file):
|
aedf6a8 to
c87e640
Compare
c8bcbad to
9c1ffd2
Compare
|
@lavalamp this is needed for 1.4. |
9c1ffd2 to
67b7c72
Compare
|
GCE e2e build/test passed for commit 67b7c72. |
|
Review status: 0 of 7 files reviewed at latest revision, 2 unresolved discussions. Comments from Reviewable |
|
Adding the label per previous comment. |
|
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
|
GCE e2e build/test passed for commit 67b7c72. |
|
Automatic merge from submit-queue |
| // DefaultGarbageCollectionPolicy returns Orphan because that was the default | ||
| // behavior before the server-side garbage collection was implemented. | ||
| func (rcStrategy) DefaultGarbageCollectionPolicy() rest.GarbageCollectionPolicy { | ||
| return rest.OrphanDependents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the policy change if I specify OrphanDependents=false in DeleteOptions now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. DeleteOptions have the highest priority. The existing finalizers on the object has the second highest priority. This default policy has the lowest priority.
What's the bug:
When deleting an RC with
deleteOptions.OrphanDependents==nil, garbage collector is supposed to treat it as `deleteOptions.OrphanDependents==true", and orphan the pods created by it. But the apiserver is not doing that.What's in the pr:
Allow each resource to specify the default garbage collection behavior in the registry. For example, RC registry's default GC behavior is Orphan, and Pod registry's default GC behavior is CascadingDeletion.
This change is