Attach SOCI index GC to Image#1502
Merged
Merged
Conversation
sondavidb
previously approved these changes
Apr 4, 2025
Contributor
|
While you have the hood open on this, perhaps it would be good to either expand TestSociCreateGarbageCollection or add a new test case to validate the new default behavior to garbage collect the index after the referenced image is removed? |
Before this change, SOCI indexes were given a root garbage collection label when using the containerd content store. This meant that in order to remove SOCI indexes, customers would have to know to delete the content in containerd (e.g. with ctr). This change adds an option to the `Build` API to skip the GC root label and instead allow the caller to manage GC labels. As an example, it updates the CLI's `create` command to set the SOCI index as a content ref for the image. When using the contaienrd content store, the SOCI index will be removed if/when the image gets removed. Signed-off-by: Kern Walster <walster@amazon.com>
sondavidb
approved these changes
Apr 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
N/A
Description of changes:
Before this change, SOCI indexes were given a root garbage collection label when using the containerd content store. This meant that in order to remove SOCI indexes, customers would have to know to delete the content in containerd (e.g. with ctr).
This change adds an option to the
BuildAPI to skip the GC root label and instead allow the caller to manage GC labels. As an example, it updates the CLI'screatecommand to set the SOCI index as a content ref for the image. When using the contaienrd content store, the SOCI index will be removed if/when the image gets removed.Testing performed:
make test && make integrationI also manually tested creating a SOCI index for an image using the containerd content store and then deleting the image.
Before the change the index still exists.
After the change, the index gets deleted.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.