Skip to content

Conversation

microyahoo
Copy link
Contributor

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

Copy link
Collaborator

@squizzi squizzi left a 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.

@squizzi squizzi requested review from Jamstah and milosgajdos April 22, 2024 22:48
@microyahoo
Copy link
Contributor Author

hi @squizzi, seems PR #4285 has already coverred this scenario.

@squizzi
Copy link
Collaborator

squizzi commented Apr 23, 2024

@microyahoo ya, it does.. I like your addition of having emit log when the repository is skipped. Perhaps rebase and add that one line change?

@squizzi
Copy link
Collaborator

squizzi commented Apr 24, 2024

@microyahoo good catch on the ManifestUnknownRevision error in the other PR, it seems yours is back on the table, let's get a test added for this, rebase and move forward with it.

@milosgajdos
Copy link
Member

@microyahoo there is a merge conflict now that needs fixing 😬

@microyahoo
Copy link
Contributor Author

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants