From a22d803a95d48c17445b2332249d7bc22795a311 Mon Sep 17 00:00:00 2001 From: He Weiwei Date: Tue, 14 Jul 2020 14:28:53 +0000 Subject: [PATCH] refactor(quota): move pkg/types to pkg/quota/types Closes #9664 Signed-off-by: He Weiwei --- src/common/models/project.go | 2 +- src/controller/quota/controller.go | 2 +- src/controller/quota/controller_test.go | 2 +- .../quota/driver/project/project.go | 2 +- .../quota/driver/project/project_test.go | 2 +- src/controller/quota/util_test.go | 2 +- src/core/api/project.go | 4 ++-- src/core/api/quota.go | 2 +- src/core/api/quota_test.go | 2 +- src/pkg/quota/dao/dao.go | 2 +- src/pkg/quota/dao/dao_test.go | 2 +- src/pkg/quota/dao/util.go | 2 +- src/pkg/quota/driver/driver.go | 2 +- src/pkg/quota/errors.go | 2 +- src/pkg/quota/manager.go | 2 +- src/pkg/quota/manager_test.go | 2 +- src/pkg/quota/models/quota.go | 2 +- src/pkg/quota/models/quota_test.go | 2 +- src/pkg/{ => quota}/types/format.go | 0 src/pkg/{ => quota}/types/format_test.go | 0 src/pkg/{ => quota}/types/resources.go | 0 src/pkg/{ => quota}/types/resources_test.go | 0 src/pkg/quota/util.go | 2 +- src/pkg/quota/util_test.go | 2 +- src/pkg/scan/dao/scanner/registration.go | 7 ++---- src/pkg/types/error.go | 24 ------------------- src/server/middleware/quota/copy_artifact.go | 2 +- .../middleware/quota/copy_artifact_test.go | 2 +- .../quota/post_initiate_blob_upload.go | 2 +- .../quota/post_initiate_blob_upload_test.go | 2 +- .../middleware/quota/put_blob_upload.go | 2 +- .../middleware/quota/put_blob_upload_test.go | 2 +- src/server/middleware/quota/put_manifest.go | 2 +- .../middleware/quota/put_manifest_test.go | 2 +- src/server/middleware/quota/quota.go | 2 +- src/server/middleware/quota/quota_test.go | 2 +- src/testing/controller/quota/controller.go | 2 +- src/testing/pkg/quota/driver/driver.go | 2 +- src/testing/pkg/quota/manager.go | 2 +- 39 files changed, 36 insertions(+), 63 deletions(-) rename src/pkg/{ => quota}/types/format.go (100%) rename src/pkg/{ => quota}/types/format_test.go (100%) rename src/pkg/{ => quota}/types/resources.go (100%) rename src/pkg/{ => quota}/types/resources_test.go (100%) delete mode 100644 src/pkg/types/error.go diff --git a/src/common/models/project.go b/src/common/models/project.go index 4c383abb8..491d81905 100644 --- a/src/common/models/project.go +++ b/src/common/models/project.go @@ -18,7 +18,7 @@ import ( "strings" "time" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) const ( diff --git a/src/controller/quota/controller.go b/src/controller/quota/controller.go index 489850922..6f6e8de17 100644 --- a/src/controller/quota/controller.go +++ b/src/controller/quota/controller.go @@ -27,7 +27,7 @@ import ( "github.com/goharbor/harbor/src/lib/q" "github.com/goharbor/harbor/src/pkg/quota" "github.com/goharbor/harbor/src/pkg/quota/driver" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" // quota driver _ "github.com/goharbor/harbor/src/controller/quota/driver" diff --git a/src/controller/quota/controller_test.go b/src/controller/quota/controller_test.go index ecf4937a8..474953ded 100644 --- a/src/controller/quota/controller_test.go +++ b/src/controller/quota/controller_test.go @@ -24,7 +24,7 @@ import ( "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/pkg/quota" "github.com/goharbor/harbor/src/pkg/quota/driver" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ormtesting "github.com/goharbor/harbor/src/testing/lib/orm" "github.com/goharbor/harbor/src/testing/mock" quotatesting "github.com/goharbor/harbor/src/testing/pkg/quota" diff --git a/src/controller/quota/driver/project/project.go b/src/controller/quota/driver/project/project.go index 4a78d49e3..a546be8bd 100644 --- a/src/controller/quota/driver/project/project.go +++ b/src/controller/quota/driver/project/project.go @@ -25,7 +25,7 @@ import ( "github.com/goharbor/harbor/src/controller/blob" "github.com/goharbor/harbor/src/lib/log" dr "github.com/goharbor/harbor/src/pkg/quota/driver" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/graph-gophers/dataloader" ) diff --git a/src/controller/quota/driver/project/project_test.go b/src/controller/quota/driver/project/project_test.go index c35e475d4..197e3bd92 100644 --- a/src/controller/quota/driver/project/project_test.go +++ b/src/controller/quota/driver/project/project_test.go @@ -18,7 +18,7 @@ import ( "context" "testing" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" artifacttesting "github.com/goharbor/harbor/src/testing/controller/artifact" blobtesting "github.com/goharbor/harbor/src/testing/controller/blob" "github.com/goharbor/harbor/src/testing/mock" diff --git a/src/controller/quota/util_test.go b/src/controller/quota/util_test.go index f55a38294..059cd4638 100644 --- a/src/controller/quota/util_test.go +++ b/src/controller/quota/util_test.go @@ -25,7 +25,7 @@ import ( "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/pkg/quota" "github.com/goharbor/harbor/src/pkg/quota/driver" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" projecttesting "github.com/goharbor/harbor/src/testing/controller/project" ormtesting "github.com/goharbor/harbor/src/testing/lib/orm" "github.com/goharbor/harbor/src/testing/mock" diff --git a/src/core/api/project.go b/src/core/api/project.go index b828710a0..3497fb685 100644 --- a/src/core/api/project.go +++ b/src/core/api/project.go @@ -17,7 +17,6 @@ package api import ( "context" "fmt" - "github.com/goharbor/harbor/src/replication" "net/http" "regexp" "strconv" @@ -38,8 +37,9 @@ import ( "github.com/goharbor/harbor/src/lib/errors" "github.com/goharbor/harbor/src/lib/log" evt "github.com/goharbor/harbor/src/pkg/notifier/event" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/goharbor/harbor/src/pkg/scan/vuln" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/replication" ) type deletableResp struct { diff --git a/src/core/api/quota.go b/src/core/api/quota.go index 839f76707..cf9a4b303 100644 --- a/src/core/api/quota.go +++ b/src/core/api/quota.go @@ -21,7 +21,7 @@ import ( "github.com/goharbor/harbor/src/lib/errors" "github.com/goharbor/harbor/src/lib/q" "github.com/goharbor/harbor/src/pkg/quota/models" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // QuotaUpdateRequest struct for the body of put quota API diff --git a/src/core/api/quota_test.go b/src/core/api/quota_test.go index 630f5583f..61cd24a53 100644 --- a/src/core/api/quota_test.go +++ b/src/core/api/quota_test.go @@ -23,7 +23,7 @@ import ( "github.com/goharbor/harbor/src/controller/quota" "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/pkg/quota/driver" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/goharbor/harbor/src/testing/apitests/apilib" "github.com/goharbor/harbor/src/testing/mock" drivertesting "github.com/goharbor/harbor/src/testing/pkg/quota/driver" diff --git a/src/pkg/quota/dao/dao.go b/src/pkg/quota/dao/dao.go index d0c2d89d2..41420c2e6 100644 --- a/src/pkg/quota/dao/dao.go +++ b/src/pkg/quota/dao/dao.go @@ -24,7 +24,7 @@ import ( "github.com/goharbor/harbor/src/lib/q" "github.com/goharbor/harbor/src/pkg/quota/driver" "github.com/goharbor/harbor/src/pkg/quota/models" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // DAO the dao for Quota and QuotaUsage diff --git a/src/pkg/quota/dao/dao_test.go b/src/pkg/quota/dao/dao_test.go index 55b49c406..9228d5e6a 100644 --- a/src/pkg/quota/dao/dao_test.go +++ b/src/pkg/quota/dao/dao_test.go @@ -21,7 +21,7 @@ import ( "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/lib/q" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" htesting "github.com/goharbor/harbor/src/testing" "github.com/google/uuid" "github.com/stretchr/testify/suite" diff --git a/src/pkg/quota/dao/util.go b/src/pkg/quota/dao/util.go index 7f0c2448d..561582e33 100644 --- a/src/pkg/quota/dao/util.go +++ b/src/pkg/quota/dao/util.go @@ -21,7 +21,7 @@ import ( "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/lib/q" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) var ( diff --git a/src/pkg/quota/driver/driver.go b/src/pkg/quota/driver/driver.go index e9431d879..ea434027d 100644 --- a/src/pkg/quota/driver/driver.go +++ b/src/pkg/quota/driver/driver.go @@ -18,7 +18,7 @@ import ( "context" "sync" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) var ( diff --git a/src/pkg/quota/errors.go b/src/pkg/quota/errors.go index 19f135eaf..000cbe72f 100644 --- a/src/pkg/quota/errors.go +++ b/src/pkg/quota/errors.go @@ -18,7 +18,7 @@ import ( "fmt" "strings" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // Errors contains all happened errors diff --git a/src/pkg/quota/manager.go b/src/pkg/quota/manager.go index b8d5f66a5..4d8048f5e 100644 --- a/src/pkg/quota/manager.go +++ b/src/pkg/quota/manager.go @@ -21,7 +21,7 @@ import ( "github.com/goharbor/harbor/src/lib/q" "github.com/goharbor/harbor/src/pkg/quota/dao" "github.com/goharbor/harbor/src/pkg/quota/models" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // Quota alias `models.Quota` to make it natural to use the Manager diff --git a/src/pkg/quota/manager_test.go b/src/pkg/quota/manager_test.go index 8cefb41c3..69a1f6ce0 100644 --- a/src/pkg/quota/manager_test.go +++ b/src/pkg/quota/manager_test.go @@ -17,7 +17,7 @@ package quota import ( "testing" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" htesting "github.com/goharbor/harbor/src/testing" "github.com/stretchr/testify/suite" ) diff --git a/src/pkg/quota/models/quota.go b/src/pkg/quota/models/quota.go index 0021f749b..2f44e601c 100644 --- a/src/pkg/quota/models/quota.go +++ b/src/pkg/quota/models/quota.go @@ -20,7 +20,7 @@ import ( "time" "github.com/goharbor/harbor/src/pkg/quota/driver" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // Quota quota model for manager diff --git a/src/pkg/quota/models/quota_test.go b/src/pkg/quota/models/quota_test.go index 8735c58ad..29bd26189 100644 --- a/src/pkg/quota/models/quota_test.go +++ b/src/pkg/quota/models/quota_test.go @@ -17,7 +17,7 @@ package models import ( "testing" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/stretchr/testify/assert" ) diff --git a/src/pkg/types/format.go b/src/pkg/quota/types/format.go similarity index 100% rename from src/pkg/types/format.go rename to src/pkg/quota/types/format.go diff --git a/src/pkg/types/format_test.go b/src/pkg/quota/types/format_test.go similarity index 100% rename from src/pkg/types/format_test.go rename to src/pkg/quota/types/format_test.go diff --git a/src/pkg/types/resources.go b/src/pkg/quota/types/resources.go similarity index 100% rename from src/pkg/types/resources.go rename to src/pkg/quota/types/resources.go diff --git a/src/pkg/types/resources_test.go b/src/pkg/quota/types/resources_test.go similarity index 100% rename from src/pkg/types/resources_test.go rename to src/pkg/quota/types/resources_test.go diff --git a/src/pkg/quota/util.go b/src/pkg/quota/util.go index 8d085d093..8e3be434f 100644 --- a/src/pkg/quota/util.go +++ b/src/pkg/quota/util.go @@ -18,7 +18,7 @@ import ( "sort" "strings" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // IsSafe check new used is safe under the hard limits diff --git a/src/pkg/quota/util_test.go b/src/pkg/quota/util_test.go index 05895731b..e21cbe34c 100644 --- a/src/pkg/quota/util_test.go +++ b/src/pkg/quota/util_test.go @@ -17,7 +17,7 @@ package quota import ( "testing" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) func TestIsSafe(t *testing.T) { diff --git a/src/pkg/scan/dao/scanner/registration.go b/src/pkg/scan/dao/scanner/registration.go index 027f802f0..ffbdfe3ba 100644 --- a/src/pkg/scan/dao/scanner/registration.go +++ b/src/pkg/scan/dao/scanner/registration.go @@ -21,8 +21,8 @@ import ( "github.com/astaxie/beego/orm" "github.com/goharbor/harbor/src/common/dao" "github.com/goharbor/harbor/src/lib/errors" + liborm "github.com/goharbor/harbor/src/lib/orm" "github.com/goharbor/harbor/src/lib/q" - "github.com/goharbor/harbor/src/pkg/types" ) func init() { @@ -35,10 +35,7 @@ func AddRegistration(r *Registration) (int64, error) { id, err := o.Insert(r) if err != nil { - if strings.Contains(err.Error(), "duplicate key value violates unique constraint") { - return 0, types.ErrDupRows - } - return 0, err + return 0, liborm.WrapConflictError(err, "registration name or url already exists") } return id, nil diff --git a/src/pkg/types/error.go b/src/pkg/types/error.go deleted file mode 100644 index c7af6d1d7..000000000 --- a/src/pkg/types/error.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright Project Harbor Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "errors" -) - -var ( - // ErrDupRows is returned by DAO when inserting failed with error "duplicate key value violates unique constraint" - ErrDupRows = errors.New("sql: duplicate row in DB") -) diff --git a/src/server/middleware/quota/copy_artifact.go b/src/server/middleware/quota/copy_artifact.go index 1a320085f..53bd344d9 100644 --- a/src/server/middleware/quota/copy_artifact.go +++ b/src/server/middleware/quota/copy_artifact.go @@ -42,7 +42,7 @@ import ( "github.com/goharbor/harbor/src/pkg/blob" "github.com/goharbor/harbor/src/pkg/distribution" "github.com/goharbor/harbor/src/pkg/notifier/event" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // CopyArtifactMiddleware middleware to request count and storage resources for copy artifact API diff --git a/src/server/middleware/quota/copy_artifact_test.go b/src/server/middleware/quota/copy_artifact_test.go index c9f261f4a..8ce720422 100644 --- a/src/server/middleware/quota/copy_artifact_test.go +++ b/src/server/middleware/quota/copy_artifact_test.go @@ -37,7 +37,7 @@ import ( "github.com/goharbor/harbor/src/controller/artifact" "github.com/goharbor/harbor/src/pkg/notification" "github.com/goharbor/harbor/src/pkg/quota" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/goharbor/harbor/src/testing/mock" "github.com/stretchr/testify/suite" ) diff --git a/src/server/middleware/quota/post_initiate_blob_upload.go b/src/server/middleware/quota/post_initiate_blob_upload.go index ec3898b23..f4653a9c3 100644 --- a/src/server/middleware/quota/post_initiate_blob_upload.go +++ b/src/server/middleware/quota/post_initiate_blob_upload.go @@ -21,7 +21,7 @@ import ( "github.com/goharbor/harbor/src/controller/blob" "github.com/goharbor/harbor/src/lib/errors" "github.com/goharbor/harbor/src/lib/log" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // PostInitiateBlobUploadMiddleware middleware to add blob to project after mount blob success diff --git a/src/server/middleware/quota/post_initiate_blob_upload_test.go b/src/server/middleware/quota/post_initiate_blob_upload_test.go index 931f30277..590810664 100644 --- a/src/server/middleware/quota/post_initiate_blob_upload_test.go +++ b/src/server/middleware/quota/post_initiate_blob_upload_test.go @@ -21,7 +21,7 @@ import ( "github.com/goharbor/harbor/src/pkg/blob" "github.com/goharbor/harbor/src/pkg/quota" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/goharbor/harbor/src/testing/mock" "github.com/stretchr/testify/suite" ) diff --git a/src/server/middleware/quota/put_blob_upload.go b/src/server/middleware/quota/put_blob_upload.go index aef32ed05..50fa32fb2 100644 --- a/src/server/middleware/quota/put_blob_upload.go +++ b/src/server/middleware/quota/put_blob_upload.go @@ -21,7 +21,7 @@ import ( "github.com/goharbor/harbor/src/controller/blob" "github.com/goharbor/harbor/src/lib/log" "github.com/goharbor/harbor/src/pkg/distribution" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // PutBlobUploadMiddleware middleware to request storage resource for the project diff --git a/src/server/middleware/quota/put_blob_upload_test.go b/src/server/middleware/quota/put_blob_upload_test.go index 980af689f..b700935d2 100644 --- a/src/server/middleware/quota/put_blob_upload_test.go +++ b/src/server/middleware/quota/put_blob_upload_test.go @@ -25,7 +25,7 @@ import ( "github.com/goharbor/harbor/src/lib/errors" "github.com/goharbor/harbor/src/pkg/notification" "github.com/goharbor/harbor/src/pkg/quota" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/goharbor/harbor/src/testing/mock" "github.com/stretchr/testify/suite" ) diff --git a/src/server/middleware/quota/put_manifest.go b/src/server/middleware/quota/put_manifest.go index 174d6f69b..2b27c3483 100644 --- a/src/server/middleware/quota/put_manifest.go +++ b/src/server/middleware/quota/put_manifest.go @@ -22,7 +22,7 @@ import ( "github.com/goharbor/harbor/src/lib/errors" "github.com/goharbor/harbor/src/lib/log" "github.com/goharbor/harbor/src/pkg/blob/models" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" ) // PutManifestMiddleware middleware to request count and storage resources for the project diff --git a/src/server/middleware/quota/put_manifest_test.go b/src/server/middleware/quota/put_manifest_test.go index 52b575c3d..d7198f3be 100644 --- a/src/server/middleware/quota/put_manifest_test.go +++ b/src/server/middleware/quota/put_manifest_test.go @@ -29,7 +29,7 @@ import ( "github.com/goharbor/harbor/src/pkg/distribution" "github.com/goharbor/harbor/src/pkg/notification" "github.com/goharbor/harbor/src/pkg/quota" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/goharbor/harbor/src/testing/mock" distributiontesting "github.com/goharbor/harbor/src/testing/pkg/distribution" "github.com/stretchr/testify/suite" diff --git a/src/server/middleware/quota/quota.go b/src/server/middleware/quota/quota.go index bccd3ccae..85f3d2ae2 100644 --- a/src/server/middleware/quota/quota.go +++ b/src/server/middleware/quota/quota.go @@ -27,7 +27,7 @@ import ( "github.com/goharbor/harbor/src/pkg/notification" "github.com/goharbor/harbor/src/pkg/notifier/event" "github.com/goharbor/harbor/src/pkg/quota" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" "github.com/goharbor/harbor/src/server/middleware" ) diff --git a/src/server/middleware/quota/quota_test.go b/src/server/middleware/quota/quota_test.go index 681d9d1ef..d1a18a1a8 100644 --- a/src/server/middleware/quota/quota_test.go +++ b/src/server/middleware/quota/quota_test.go @@ -26,7 +26,7 @@ import ( "github.com/goharbor/harbor/src/controller/project" "github.com/goharbor/harbor/src/controller/quota" pquota "github.com/goharbor/harbor/src/pkg/quota" - "github.com/goharbor/harbor/src/pkg/types" + "github.com/goharbor/harbor/src/pkg/quota/types" artifacttesting "github.com/goharbor/harbor/src/testing/controller/artifact" blobtesting "github.com/goharbor/harbor/src/testing/controller/blob" projecttesting "github.com/goharbor/harbor/src/testing/controller/project" diff --git a/src/testing/controller/quota/controller.go b/src/testing/controller/quota/controller.go index f20593a3c..37bf6bf71 100644 --- a/src/testing/controller/quota/controller.go +++ b/src/testing/controller/quota/controller.go @@ -12,7 +12,7 @@ import ( quota "github.com/goharbor/harbor/src/controller/quota" - types "github.com/goharbor/harbor/src/pkg/types" + types "github.com/goharbor/harbor/src/pkg/quota/types" ) // Controller is an autogenerated mock type for the Controller type diff --git a/src/testing/pkg/quota/driver/driver.go b/src/testing/pkg/quota/driver/driver.go index c6c2ebe13..8169eab34 100644 --- a/src/testing/pkg/quota/driver/driver.go +++ b/src/testing/pkg/quota/driver/driver.go @@ -8,7 +8,7 @@ import ( driver "github.com/goharbor/harbor/src/pkg/quota/driver" mock "github.com/stretchr/testify/mock" - types "github.com/goharbor/harbor/src/pkg/types" + types "github.com/goharbor/harbor/src/pkg/quota/types" ) // Driver is an autogenerated mock type for the Driver type diff --git a/src/testing/pkg/quota/manager.go b/src/testing/pkg/quota/manager.go index 155820087..0180fde4d 100644 --- a/src/testing/pkg/quota/manager.go +++ b/src/testing/pkg/quota/manager.go @@ -10,7 +10,7 @@ import ( q "github.com/goharbor/harbor/src/lib/q" - types "github.com/goharbor/harbor/src/pkg/types" + types "github.com/goharbor/harbor/src/pkg/quota/types" ) // Manager is an autogenerated mock type for the Manager type