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

Add support for garbage collecting images. #3097

Merged
merged 1 commit into from
Dec 23, 2014

Conversation

brendandburns
Copy link
Contributor

Closes #157

@@ -203,6 +208,38 @@ func (kl *Kubelet) purgeOldest(ids []string) error {
return nil
}

func (kl *Kubelet) GarbageCollectLoop() {
func() {
Copy link
Member

Choose a reason for hiding this comment

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

This anonymous function seems superfluous?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed it does. copy and paste from the old function. Removed.

@brendandburns
Copy link
Contributor Author

comment addressed. ptal.

THanks!
--brendan

@lavalamp
Copy link
Member

LGTM

lavalamp added a commit that referenced this pull request Dec 23, 2014
Add support for garbage collecting images.
@lavalamp lavalamp merged commit 05a0c5c into kubernetes:master Dec 23, 2014
@lavalamp
Copy link
Member

I suspect this broke the liveness test? Not sure - will know more later. See #3108

In general, what's to prevent an image from getting cleaned up after it's pulled but before it's started?

@brendandburns
Copy link
Contributor Author

I don't think that my PR is the cause. Esp. because liveness.sh failed in
http://bburns-linux.sea.corp.google.com:8080/job/kubernetes/1025/, but e2e
for this PR wasn't run until
http://bburns-linux.sea.corp.google.com:8080/job/kubernetes/1026/ where
liveness worked.

The docs for dangling are here

https://docs.docker.com/reference/commandline/cli/ (search for "dangling")

They:

"This will display untagged images, that are the leaves of the images tree
(not intermediary layers). These images occur when a new build of an image
takes the repo:tag away from the image ID, leaving it untagged."

So unless the tag isn't placed until a long while after the pull completes,
it seems unlikely it could cause this.

I think I see the reason for the flake in liveness.sh, I think I pulled the
initial restarts number prior to the pod actually being fully up, so there
was no value to pull. I will catch and poll until I get a
number.

Will add this as a note on the issue you filed.

On Mon, Dec 22, 2014 at 6:21 PM, Daniel Smith notifications@github.com
wrote:

I suspect this broke the liveness test? Not sure - will know more later.
See #3108 #3108

In general, what's to prevent an image from getting cleaned up after it's
pulled but before it's started?


Reply to this email directly or view it on GitHub
#3097 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GC old dead containers and unused images
3 participants