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 image expiration during garbage collection #9022
Conversation
Make it easier to see list differences in gc node test failure output. Signed-off-by: Derek McGowan <derek@mcg.dev>
cc @cardyok |
} | ||
|
||
// If image doesn't have expiration, it does not need to be leased | ||
if _, ok := labels[string(labelGCExpire)]; !ok { |
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.
Suggest to add integration test case for this. I think it will be a good example for developer.
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.
Let me look into adding a test under images for this, we don't usually unit test the non exported functions. I did find another fix for one of the tests though
51a4b17
to
0949935
Compare
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.
LGTM
One generic question: would the gc of an expired image consequently lead to GC of related resources like contents and snapshots? |
Update the garbage collector to support image expiration along with support for image leasing. This allows making images collectible during garbage collection and using a lease to prevent removal of an image. Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
0949935
to
cd705af
Compare
Yes, gc of an expired image is the equivalent of an image delete + gc |
Update the garbage collector to support image expiration along with support for image leasing. This allows making images collectible during garbage collection and using a lease to prevent removal of an image.
The
containerd.io/gc.ref.image
label will also allow other other objects to reference an image directly, rather than just the content. This is useful to keep around image metadata and labels rather than just the image manifest.