Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

dist: add tests for listing repos, tags #5

Closed
wants to merge 2 commits into from

Conversation

dongsupark
Copy link
Collaborator

Added tests for listing existing repos and tags of a given manifest.


indexServer := auth.GetIndexServer(regURL)

// NOTE: it will fail when testing against docker.io, as '/v2/_catalog' endpoint

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense to test in the context of OCI. _context isn't a standard path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand from the spec, GET /v2/_catalog indeed seems to be in the spec.

Do you mean that the listing repo part of the spec needs to be changed?
Or do you mean that the spec is correct, but tests should not take into account that part of the spec, because it's implementation specific?

BTW I see this code has a bug. I'll fix it soon.


regAuthCtx := auth.NewRegAuthContext()
remoteName := filepath.Join(auth.DefaultRepoPrefix, testImageName)
reqPath := filepath.Join(remoteName, "tags/list")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to also check the /tags/ endpoint. This should have been merged into the spec, but I am not sure on the status of that PR.

cc @dmcgowan

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do the change. Thanks.

Dongsu Park added 2 commits December 19, 2018 16:07
Added tests for listing existing repos and tags of a given manifest.

Signed-off-by: Dongsu Park <[email protected]>
Before checking for /tags/list, we should also check if /tags is
available.

Signed-off-by: Dongsu Park <[email protected]>
@dongsupark
Copy link
Collaborator Author

From now on, we should add code to https://github.com/opencontainers/distribution-spec.
So please look at opencontainers/distribution-spec#39.
I will deal with open issues in the distribution-spec PR.

@dongsupark dongsupark closed this Dec 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants