Repository navigation
fix: ignore error of manifest tag path not found in gc - #4331
Merged
Merged
Conversation
squizzi
requested changes
Apr 22, 2024
squizzi
left a comment
Collaborator
There was a problem hiding this comment.
I feel you could add a test for this that tests that GC does not error on an unknown repository, something like:
func TestGCWithUnknownRepository(t *testing.T) {
d := inmemory.New()
registry := createRegistry(t, d)
repo := makeRepository(t, registry, "nonexistentrepo")
uploadRandomSchema2Image(t, repo)
err := MarkAndSweep(dcontext.Background(), d, registry, GCOpts{
DryRun: false,
RemoveUntagged: true,
})
if err != nil {
t.Fatalf("got error: %v, expected nil", err)
}
}Passes with this addition but fails without it.
Contributor
Author
Collaborator
|
@microyahoo ya, it does.. I like your addition of having |
Collaborator
|
@microyahoo good catch on the |
Member
|
@microyahoo there is a merge conflict now that needs fixing 😬 |
Contributor
Author
hi @milosgajdos, thanks for you kindly reminder, I will fix it ASAP. |
it is reasonable to ignore the error that the manifest tag path does not exist when querying all tags of the specified repository when executing gc. Signed-off-by: Liang Zheng <[email protected]>
milosgajdos
approved these changes
Apr 25, 2024
squizzi
approved these changes
Apr 25, 2024
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.
it is reasonable to ignore the error that the manifest tag path does not exist when querying all tags of the specified repository when executing gc.
Signed-off-by: Liang Zheng [email protected]