-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Use runtime instread of dockerclient in container gc #15051
Use runtime instread of dockerclient in container gc #15051
Conversation
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
Labelling this PR as size/XL |
@@ -57,6 +58,8 @@ type Runtime interface { | |||
// specifies whether the runtime returns all containers including those already | |||
// exited and dead containers (used for garbage collection). | |||
GetPods(all bool) ([]*Pod, error) | |||
// Garbage collection of dead containers |
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.
use proper go doc conventions.
// GarbageCollect removes dead containers using the specified criteria
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.
@derekwaynecarr thanks
540fd54
to
42d7202
Compare
@yujuhong: I haven't thought through disk management yet. We might end up exposing additional runtime APIs. Image management is specific to the runtime and so this PR makes sense overall. |
Labelling this PR as size/L |
@@ -1082,7 +1082,7 @@ func (r *runtime) GetContainerLogs(pod *api.Pod, containerID string, logOptions | |||
} | |||
|
|||
// GarbageCollect collects the pods/containers. TODO(yifan): Enforce the gc policy. | |||
func (r *runtime) GarbageCollect() error { | |||
func (r *runtime) GarbageCollect(gcPolicy kubecontainer.ContainerGCPolicy) error { |
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.
So if #14686 gets in first, then the change we need to make is to derive the --grace-period
and --expire-prepared
from the gcPolicy.MinAge
. AFAICS we can just set both the the gcPolicy.MinAge
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.
@yifan-gu OK
@k8s-bot ok to test |
PR looks good to me overall. Will review again after rebase and apply the lgtm label. Thanks for the PR! |
Unit, integration and GCE e2e test build/test passed for commit 42d72027d802a951d4fdbb6fc9b9a26602366fd4. |
@yujuhong Shippable is so slow now |
GCE e2e test build/test passed for commit f0d1b6935df4e9d5242b103380b2874125dd2a71. |
f0d1b69
to
673a9a7
Compare
GCE e2e test build/test passed for commit 673a9a7c69e97f877193f1ca7dce7c768214f21f. |
Mergebot is also slow or not working :\ Sorry for the wait. |
673a9a7
to
cfa60a5
Compare
GCE e2e build/test failed for commit cfa60a56fbe08f913b2314b23941acbaecddd9c1. |
cfa60a5
to
74b5b0c
Compare
GCE e2e test build/test passed for commit 74b5b0c25fc186ec6221b6fe80d58608188bb9ed. |
LGTM |
74b5b0c
to
fb04ede
Compare
GCE e2e test build/test passed for commit fb04ede. |
Thanks for rebasing. |
Continuous integration appears to have missed, closing and re-opening to trigger it |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit fb04ede. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
Refactor container garbage collection to use runtime interface instead.
This refactor is a pre-requirement for client/server runtime at #13768