From cc1938a04cfe3918c5eb4c2d38cf84def981de30 Mon Sep 17 00:00:00 2001 From: lxShaDoWxl Date: Fri, 24 Jan 2020 21:17:45 +0600 Subject: [PATCH] tests(Registries/Gitlab): Added tests for gitlab adapter Signed-off-by: lxShaDoWxl --- .../adapter/gitlab/adapter_test.go | 125 ++++++++++++++++++ .../gitlab/testdata/projects/-docker.json | 97 ++++++++++++++ .../adapter/gitlab/testdata/projects/all.json | 96 ++++++++++++++ .../gitlab/testdata/projects/dev-.json | 96 ++++++++++++++ .../gitlab/testdata/projects/dev-docker.json | 96 ++++++++++++++ .../gitlab/testdata/repositories/1.json | 10 ++ .../gitlab/testdata/repositories/2.json | 10 ++ .../gitlab/testdata/repositories/3.json | 10 ++ .../gitlab/testdata/repositories/4.json | 10 ++ .../gitlab/testdata/repositories/5.json | 10 ++ .../adapter/gitlab/testdata/tags/11.json | 17 +++ .../adapter/gitlab/testdata/tags/21.json | 17 +++ .../adapter/gitlab/testdata/tags/31.json | 17 +++ .../adapter/gitlab/testdata/tags/41.json | 22 +++ .../adapter/gitlab/testdata/tags/51.json | 22 +++ 15 files changed, 655 insertions(+) create mode 100644 src/replication/adapter/gitlab/adapter_test.go create mode 100644 src/replication/adapter/gitlab/testdata/projects/-docker.json create mode 100644 src/replication/adapter/gitlab/testdata/projects/all.json create mode 100644 src/replication/adapter/gitlab/testdata/projects/dev-.json create mode 100644 src/replication/adapter/gitlab/testdata/projects/dev-docker.json create mode 100644 src/replication/adapter/gitlab/testdata/repositories/1.json create mode 100644 src/replication/adapter/gitlab/testdata/repositories/2.json create mode 100644 src/replication/adapter/gitlab/testdata/repositories/3.json create mode 100644 src/replication/adapter/gitlab/testdata/repositories/4.json create mode 100644 src/replication/adapter/gitlab/testdata/repositories/5.json create mode 100644 src/replication/adapter/gitlab/testdata/tags/11.json create mode 100644 src/replication/adapter/gitlab/testdata/tags/21.json create mode 100644 src/replication/adapter/gitlab/testdata/tags/31.json create mode 100644 src/replication/adapter/gitlab/testdata/tags/41.json create mode 100644 src/replication/adapter/gitlab/testdata/tags/51.json diff --git a/src/replication/adapter/gitlab/adapter_test.go b/src/replication/adapter/gitlab/adapter_test.go new file mode 100644 index 000000000..ea85887fc --- /dev/null +++ b/src/replication/adapter/gitlab/adapter_test.go @@ -0,0 +1,125 @@ +package gitlab + +import ( + adp "github.com/goharbor/harbor/src/replication/adapter" + "github.com/goharbor/harbor/src/replication/model" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "io" + "net/http" + "net/http/httptest" + "os" + "regexp" + "strconv" + "testing" +) + +func mustWriteHTTPResponse(t *testing.T, w io.Writer, fixturePath string) { + f, err := os.Open(fixturePath) + if err != nil { + t.Fatalf("error opening fixture file: %v", err) + } + + if _, err = io.Copy(w, f); err != nil { + t.Fatalf("error writing response: %v", err) + } +} +func getServer(t *testing.T) *httptest.Server { + mux := http.NewServeMux() + mux.HandleFunc("/v2/", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Www-Authenticate", "Bearer realm=\"http://"+r.Host+"/jwt/auth\",service=\"container_registry\"") + w.WriteHeader(http.StatusUnauthorized) + + }) + mux.HandleFunc("/api/v4/projects", func(w http.ResponseWriter, r *http.Request) { + search := r.URL.Query().Get("search") + w.Header().Set("X-Next-Page", "") + + switch search { + case "dev-docker": + mustWriteHTTPResponse(t, w, "testdata/projects/dev-docker.json") + break + case "dev-": + mustWriteHTTPResponse(t, w, "testdata/projects/dev-docker.json") + break + case "-docker": + mustWriteHTTPResponse(t, w, "testdata/projects/-docker.json") + break + case "": + mustWriteHTTPResponse(t, w, "testdata/projects/all.json") + break + default: + w.Header().Set("X-Next-Page", "") + w.Write([]byte(`[]`)) + break + } + + }) + for projectID := 1; projectID <= 5; projectID++ { + mux.HandleFunc("/api/v4/projects/"+strconv.Itoa(projectID)+"/registry/repositories", func(w http.ResponseWriter, r *http.Request) { + + w.Header().Set("X-Next-Page", "") + re := regexp.MustCompile(`projects/(?P\d+)/registry`) + match := re.FindStringSubmatch(r.RequestURI) + mustWriteHTTPResponse(t, w, "testdata/repositories/"+match[1]+".json") + + }) + for repositoryID := 1; repositoryID <= 5; repositoryID++ { + mux.HandleFunc("/api/v4/projects/"+strconv.Itoa(projectID)+"/registry/repositories/"+strconv.Itoa(repositoryID)+"1/tags", func(w http.ResponseWriter, r *http.Request) { + + w.Header().Set("X-Next-Page", "") + re := regexp.MustCompile(`repositories/(?P\d+)/tags`) + match := re.FindStringSubmatch(r.RequestURI) + mustWriteHTTPResponse(t, w, "testdata/tags/"+match[1]+".json") + + }) + + } + } + server := httptest.NewServer(mux) + return server +} + +func getAdapter(t *testing.T) adp.Adapter { + assertions := assert.New(t) + factory, err := adp.GetFactory(model.RegistryTypeGitLab) + assertions.Nil(err) + assertions.NotNil(factory) + server := getServer(t) + adapter, err := newAdapter(&model.Registry{ + Type: model.RegistryTypeGitLab, + URL: server.URL, + Credential: &model.Credential{ + AccessKey: "test", + AccessSecret: "test", + }, + }) + assertions.Nil(err) + assertions.NotNil(adapter) + + return adapter +} +func TestFetchImages(t *testing.T) { + assertions := assert.New(t) + + ad := getAdapter(t) + adapter := ad.(*adapter) + templates := map[string]int{ + "library/dev-docker": 1, + "library/*-docker": 1, + "library/dev-*": 2, + "*/dev-docker": 1, + "library/*": 2, + } + for k, v := range templates { + resources, err := adapter.FetchImages([]*model.Filter{ + { + Type: model.FilterTypeName, + Value: k, + }, + }) + require.Nil(t, err, k, v) + assertions.Len(resources, v, k, v) + } + +} diff --git a/src/replication/adapter/gitlab/testdata/projects/-docker.json b/src/replication/adapter/gitlab/testdata/projects/-docker.json new file mode 100644 index 000000000..3bd096f8b --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/projects/-docker.json @@ -0,0 +1,97 @@ +[ + { + "id": 3, + "description": "", + "name": "dev-docker", + "name_with_namespace": "Library / dev-docker", + "path": "dev-docker", + "path_with_namespace": "library/dev-docker", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + }, + { + "id": 4, + "description": "", + "name": "dev-docker-test", + "name_with_namespace": "Library / dev-docker-test", + "path": "dev-docker-test", + "path_with_namespace": "library/dev-docker-test", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + } + +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/projects/all.json b/src/replication/adapter/gitlab/testdata/projects/all.json new file mode 100644 index 000000000..802317fd9 --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/projects/all.json @@ -0,0 +1,96 @@ +[ + { + "id": 1, + "description": "", + "name": "dockers", + "name_with_namespace": "Library / dockers", + "path": "dockers", + "path_with_namespace": "library/dockers", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + }, + { + "id": 5, + "description": "", + "name": "example-dockers", + "name_with_namespace": "Library / example-dockers", + "path": "example-dockers", + "path_with_namespace": "library/example-dockers", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/projects/dev-.json b/src/replication/adapter/gitlab/testdata/projects/dev-.json new file mode 100644 index 000000000..7c1b6237c --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/projects/dev-.json @@ -0,0 +1,96 @@ +[ + { + "id": 3, + "description": "", + "name": "dev-docker", + "name_with_namespace": "Library / dev-docker", + "path": "dev-docker", + "path_with_namespace": "library/dev-docker", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + }, + { + "id": 4, + "description": "", + "name": "dev-docker-test", + "name_with_namespace": "Library / dev-docker-test", + "path": "dev-docker-test", + "path_with_namespace": "library/dev-docker-test", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/projects/dev-docker.json b/src/replication/adapter/gitlab/testdata/projects/dev-docker.json new file mode 100644 index 000000000..7c1b6237c --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/projects/dev-docker.json @@ -0,0 +1,96 @@ +[ + { + "id": 3, + "description": "", + "name": "dev-docker", + "name_with_namespace": "Library / dev-docker", + "path": "dev-docker", + "path_with_namespace": "library/dev-docker", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + }, + { + "id": 4, + "description": "", + "name": "dev-docker-test", + "name_with_namespace": "Library / dev-docker-test", + "path": "dev-docker-test", + "path_with_namespace": "library/dev-docker-test", + "created_at": "2019-01-17T09:47:07.504Z", + "default_branch": "master", + "tag_list": [], + + "avatar_url": null, + "star_count": 0, + "forks_count": 0, + "last_activity_at": "2019-06-09T15:18:10.045Z", + "empty_repo": false, + "archived": false, + "visibility": "private", + "resolve_outdated_diff_discussions": false, + "container_registry_enabled": true, + "issues_enabled": true, + "merge_requests_enabled": true, + "wiki_enabled": true, + "jobs_enabled": true, + "snippets_enabled": true, + "shared_runners_enabled": true, + "lfs_enabled": true, + "creator_id": 1, + "forked_from_project": {}, + "import_status": "finished", + "open_issues_count": 0, + "ci_default_git_depth": null, + "public_jobs": true, + "ci_config_path": null, + "shared_with_groups": [], + "only_allow_merge_if_pipeline_succeeds": false, + "request_access_enabled": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "printing_merge_request_link_enabled": true, + "merge_method": "merge", + "external_authorization_classification_label": "", + "permissions": { + "project_access": null, + "group_access": null + }, + "mirror": false + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/repositories/1.json b/src/replication/adapter/gitlab/testdata/repositories/1.json new file mode 100644 index 000000000..49d75f7d2 --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/repositories/1.json @@ -0,0 +1,10 @@ +[ + { + "id": 11, + "name": "", + "path": "library/dockers", + "project_id": 1, + "location": "registry.gitlab.com/library/dockers", + "created_at": "2019-01-17T09:47:07.504Z" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/repositories/2.json b/src/replication/adapter/gitlab/testdata/repositories/2.json new file mode 100644 index 000000000..0b9a55d9f --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/repositories/2.json @@ -0,0 +1,10 @@ +[ + { + "id": 21, + "name": "", + "path": "library/test-docker", + "project_id": 2, + "location": "registry.gitlab.com/library/test-docker", + "created_at": "2019-01-17T09:47:07.504Z" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/repositories/3.json b/src/replication/adapter/gitlab/testdata/repositories/3.json new file mode 100644 index 000000000..811200f3a --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/repositories/3.json @@ -0,0 +1,10 @@ +[ + { + "id": 31, + "name": "", + "path": "library/dev-docker", + "project_id": 3, + "location": "registry.gitlab.com/library/dev-docker", + "created_at": "2019-01-17T09:47:07.504Z" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/repositories/4.json b/src/replication/adapter/gitlab/testdata/repositories/4.json new file mode 100644 index 000000000..526004b98 --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/repositories/4.json @@ -0,0 +1,10 @@ +[ + { + "id": 41, + "name": "", + "path": "library/dev-docker-test", + "project_id": 4, + "location": "registry.gitlab.com/library/dev-docker-test", + "created_at": "2019-01-17T09:47:07.504Z" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/repositories/5.json b/src/replication/adapter/gitlab/testdata/repositories/5.json new file mode 100644 index 000000000..368f32baa --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/repositories/5.json @@ -0,0 +1,10 @@ +[ + { + "id": 51, + "name": "", + "path": "library/example-dockers", + "project_id": 5, + "location": "registry.gitlab.com/library/example-dockers", + "created_at": "2019-01-17T09:47:07.504Z" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/tags/11.json b/src/replication/adapter/gitlab/testdata/tags/11.json new file mode 100644 index 000000000..fe3837dbc --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/tags/11.json @@ -0,0 +1,17 @@ +[ + { + "name": "harbor", + "path": "library/dockers:harbor", + "location": "registry.gitlab.com/library/dockers:harbor" + }, + { + "name": "latest", + "path": "library/dockers:latest", + "location": "registry.gitlab.com/library/dockers:latest" + }, + { + "name": "v2", + "path": "library/dockers:v2", + "location": "registry.gitlab.com/library/dockers:v2" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/tags/21.json b/src/replication/adapter/gitlab/testdata/tags/21.json new file mode 100644 index 000000000..5b666dfc5 --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/tags/21.json @@ -0,0 +1,17 @@ +[ + { + "name": "harbor", + "path": "library/test-docker:harbor", + "location": "registry.gitlab.com/library/test-docker:harbor" + }, + { + "name": "latest", + "path": "library/test-docker:latest", + "location": "registry.gitlab.com/library/test-docker:latest" + }, + { + "name": "v2", + "path": "library/test-docker:v2", + "location": "registry.gitlab.com/library/test-docker:v2" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/tags/31.json b/src/replication/adapter/gitlab/testdata/tags/31.json new file mode 100644 index 000000000..ff11a9ab4 --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/tags/31.json @@ -0,0 +1,17 @@ +[ + { + "name": "harbor", + "path": "library/dev-docker:harbor", + "location": "registry.gitlab.com/library/dev-docker:harbor" + }, + { + "name": "latest", + "path": "library/dev-docker:latest", + "location": "registry.gitlab.com/library/dev-docker:latest" + }, + { + "name": "v2", + "path": "library/dev-docker:v2", + "location": "registry.gitlab.com/library/dev-docker:v2" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/tags/41.json b/src/replication/adapter/gitlab/testdata/tags/41.json new file mode 100644 index 000000000..17b7bc10d --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/tags/41.json @@ -0,0 +1,22 @@ +[ + { + "name": "harbor", + "path": "library/dev-docker-test:harbor", + "location": "registry.gitlab.com/library/dev-docker-test:harbor" + }, + { + "name": "latest", + "path": "library/dev-docker-test:latest", + "location": "registry.gitlab.com/library/dev-docker-test:latest" + }, + { + "name": "v2", + "path": "library/dev-docker-test:v2", + "location": "registry.gitlab.com/library/dev-docker-test:v2" + }, + { + "name": "v3", + "path": "library/dev-docker-test:v3", + "location": "registry.gitlab.com/library/dev-docker-test:v3" + } +] \ No newline at end of file diff --git a/src/replication/adapter/gitlab/testdata/tags/51.json b/src/replication/adapter/gitlab/testdata/tags/51.json new file mode 100644 index 000000000..5e14fded1 --- /dev/null +++ b/src/replication/adapter/gitlab/testdata/tags/51.json @@ -0,0 +1,22 @@ +[ + { + "name": "harbor", + "path": "library/example-dockers:harbor", + "location": "registry.gitlab.com/library/example-dockers:harbor" + }, + { + "name": "latest", + "path": "library/example-dockers:latest", + "location": "registry.gitlab.com/library/example-dockers:latest" + }, + { + "name": "v2", + "path": "library/example-dockers:v2", + "location": "registry.gitlab.com/library/example-dockers:v2" + }, + { + "name": "v3", + "path": "library/example-dockers:v3", + "location": "registry.gitlab.com/library/example-dockers:v3" + } +] \ No newline at end of file