-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: ignore error of manifest tag path not found in gc #4331
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
Conversation
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.
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.
@microyahoo ya, it does.. I like your addition of having |
@microyahoo good catch on the |
@microyahoo there is a merge conflict now that needs fixing 😬 |
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 <zhengliang0901@gmail.com>
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 zhengliang0901@gmail.com