From 7fb1bc538c62b65d1867c41168a1a4397ecdcc96 Mon Sep 17 00:00:00 2001 From: He Weiwei Date: Fri, 14 May 2021 17:15:44 +0800 Subject: [PATCH] refactor: remove unused core/api/models pkg (#14882) Signed-off-by: He Weiwei --- src/core/api/harborapi_test.go | 11 ----------- src/core/api/models/registry.go | 12 ------------ 2 files changed, 23 deletions(-) delete mode 100644 src/core/api/models/registry.go diff --git a/src/core/api/harborapi_test.go b/src/core/api/harborapi_test.go index 9653f4279..99650dd4a 100644 --- a/src/core/api/harborapi_test.go +++ b/src/core/api/harborapi_test.go @@ -35,7 +35,6 @@ import ( "github.com/goharbor/harbor/src/common/job/test" "github.com/goharbor/harbor/src/common/models" testutils "github.com/goharbor/harbor/src/common/utils/test" - apimodels "github.com/goharbor/harbor/src/core/api/models" _ "github.com/goharbor/harbor/src/core/auth/db" _ "github.com/goharbor/harbor/src/core/auth/ldap" "github.com/goharbor/harbor/src/lib/config" @@ -740,13 +739,3 @@ func (a testapi) RegistryDelete(authInfo usrInfo, registryID int64) (int, error) return code, nil } - -func (a testapi) RegistryUpdate(authInfo usrInfo, registryID int64, req *apimodels.RegistryUpdateRequest) (int, error) { - _sling := sling.New().Base(a.basePath).Put(fmt.Sprintf("/api/registries/%d", registryID)).BodyJSON(req) - code, _, err := request(_sling, jsonAcceptHeader, authInfo) - if err != nil || code != http.StatusOK { - return code, fmt.Errorf("update registry error: %v", err) - } - - return code, nil -} diff --git a/src/core/api/models/registry.go b/src/core/api/models/registry.go deleted file mode 100644 index 09b12eb08..000000000 --- a/src/core/api/models/registry.go +++ /dev/null @@ -1,12 +0,0 @@ -package models - -// RegistryUpdateRequest is request used to update a registry. -type RegistryUpdateRequest struct { - Name *string `json:"name"` - Description *string `json:"description"` - URL *string `json:"url"` - CredentialType *string `json:"credential_type"` - AccessKey *string `json:"access_key"` - AccessSecret *string `json:"access_secret"` - Insecure *bool `json:"insecure"` -}