Skip to content

Commit

Permalink
dist: check also for the path /tags
Browse files Browse the repository at this point in the history
Before checking for /tags/list, we should also check if /tags is
available.

Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
  • Loading branch information
Dongsu Park committed Dec 21, 2018
1 parent b1de6b8 commit 8cd2d81
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/dist/dist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,21 @@ func testPullManifest(t *testing.T) {
if _, err := regAuthCtx.GetResponse(inputURL, "GET", nil, []int{http.StatusOK}); err != nil {
t.Fatalf("got an unexpected reply: %v", err)
}

reqPath = filepath.Join(remoteName, "tags/list")

regAuthCtx.Scope.RemoteName = remoteName
regAuthCtx.Scope.Actions = "pull"

if err := regAuthCtx.PrepareAuth(indexServer); err != nil {
t.Fatalf("failed to prepare auth to %s for %s: %v", indexServer, reqPath, err)
}

inputURL = "https://" + indexServer + "/v2/" + reqPath

if _, err := regAuthCtx.GetResponse(inputURL, "GET", nil, []int{http.StatusOK}); err != nil {
t.Fatalf("got an unexpected reply: %v", err)
}
}

func testPullLayer(t *testing.T) {
Expand Down Expand Up @@ -301,7 +316,7 @@ func TestListTags(t *testing.T) {
indexServer := auth.GetIndexServer(regURL)

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

regAuthCtx.Scope.RemoteName = remoteName
regAuthCtx.Scope.Actions = "pull"
Expand Down

0 comments on commit 8cd2d81

Please sign in to comment.