diff --git a/cmd/zb/helper.go b/cmd/zb/helper.go index cd93fbf3..e63d820a 100644 --- a/cmd/zb/helper.go +++ b/cmd/zb/helper.go @@ -17,6 +17,7 @@ import ( imeta "github.com/opencontainers/image-spec/specs-go" ispec "github.com/opencontainers/image-spec/specs-go/v1" "gopkg.in/resty.v1" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/test" ) diff --git a/cmd/zb/main.go b/cmd/zb/main.go index fa1bcae1..a802d4f4 100644 --- a/cmd/zb/main.go +++ b/cmd/zb/main.go @@ -6,6 +6,7 @@ import ( distspec "github.com/opencontainers/distribution-spec/specs-go" "github.com/rs/zerolog/log" "github.com/spf13/cobra" + "zotregistry.io/zot/pkg/api/config" ) diff --git a/cmd/zb/main_test.go b/cmd/zb/main_test.go index 4507fccb..2989ed53 100644 --- a/cmd/zb/main_test.go +++ b/cmd/zb/main_test.go @@ -4,6 +4,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" ) diff --git a/cmd/zb/perf.go b/cmd/zb/perf.go index f27c907a..e62ac0c1 100644 --- a/cmd/zb/perf.go +++ b/cmd/zb/perf.go @@ -20,6 +20,7 @@ import ( jsoniter "github.com/json-iterator/go" godigest "github.com/opencontainers/go-digest" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api/constants" ) diff --git a/cmd/zli/main_test.go b/cmd/zli/main_test.go index df0a0f57..9e1af2e8 100644 --- a/cmd/zli/main_test.go +++ b/cmd/zli/main_test.go @@ -4,6 +4,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/cli" diff --git a/cmd/zot/main_test.go b/cmd/zot/main_test.go index 8ee5d9dd..ccfbb4ac 100644 --- a/cmd/zot/main_test.go +++ b/cmd/zot/main_test.go @@ -4,6 +4,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/cli" diff --git a/golangcilint.yaml b/golangcilint.yaml index 4bca74d6..f140f625 100644 --- a/golangcilint.yaml +++ b/golangcilint.yaml @@ -32,6 +32,11 @@ linters-settings: - w *os.File - to int64 - l *ldap.Conn + gci: + sections: + - standard + - default + - prefix(zotregistry.io/zot) wsl: allow-assign-and-anything: true enforce-err-cuddling: true @@ -69,3 +74,4 @@ issues: linters: - lll - varnamelen + - gci diff --git a/pkg/api/authn.go b/pkg/api/authn.go index ab859a50..7ad0d26e 100644 --- a/pkg/api/authn.go +++ b/pkg/api/authn.go @@ -14,6 +14,7 @@ import ( "github.com/chartmuseum/auth" "github.com/gorilla/mux" "golang.org/x/crypto/bcrypt" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api/config" ) diff --git a/pkg/api/authz.go b/pkg/api/authz.go index 6f14f31d..4204007d 100644 --- a/pkg/api/authz.go +++ b/pkg/api/authz.go @@ -9,6 +9,7 @@ import ( glob "github.com/bmatcuk/doublestar/v4" "github.com/gorilla/mux" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" "zotregistry.io/zot/pkg/common" diff --git a/pkg/api/config/config.go b/pkg/api/config/config.go index dd7dbe2b..117fef57 100644 --- a/pkg/api/config/config.go +++ b/pkg/api/config/config.go @@ -8,6 +8,7 @@ import ( "github.com/getlantern/deepcopy" distspec "github.com/opencontainers/distribution-spec/specs-go" "github.com/spf13/viper" + extconf "zotregistry.io/zot/pkg/extensions/config" "zotregistry.io/zot/pkg/storage" ) diff --git a/pkg/api/config/config_elevated_test.go b/pkg/api/config/config_elevated_test.go index c7953e32..3b1a0b0c 100644 --- a/pkg/api/config/config_elevated_test.go +++ b/pkg/api/config/config_elevated_test.go @@ -8,6 +8,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api/config" ) diff --git a/pkg/api/config/config_test.go b/pkg/api/config/config_test.go index 85611e0d..b40d14a2 100644 --- a/pkg/api/config/config_test.go +++ b/pkg/api/config/config_test.go @@ -5,6 +5,7 @@ import ( "time" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api/config" ) diff --git a/pkg/api/controller.go b/pkg/api/controller.go index e3ffa818..48211b08 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -18,6 +18,7 @@ import ( "github.com/docker/distribution/registry/storage/driver/factory" "github.com/gorilla/handlers" "github.com/gorilla/mux" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api/config" ext "zotregistry.io/zot/pkg/extensions" diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index 6f0c669b..bb1f5a13 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -43,6 +43,7 @@ import ( "github.com/stretchr/testify/assert" "golang.org/x/crypto/bcrypt" "gopkg.in/resty.v1" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" diff --git a/pkg/api/errors_test.go b/pkg/api/errors_test.go index 26d4b7ca..641c3dbc 100644 --- a/pkg/api/errors_test.go +++ b/pkg/api/errors_test.go @@ -4,6 +4,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api" ) diff --git a/pkg/api/ldap.go b/pkg/api/ldap.go index 5b337aad..84bb78c3 100644 --- a/pkg/api/ldap.go +++ b/pkg/api/ldap.go @@ -10,6 +10,7 @@ import ( "time" "github.com/go-ldap/ldap/v3" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/log" ) diff --git a/pkg/api/routes.go b/pkg/api/routes.go index 8794a605..4122ef8b 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -25,6 +25,7 @@ import ( "github.com/opencontainers/distribution-spec/specs-go/v1/extensions" ispec "github.com/opencontainers/image-spec/specs-go/v1" artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api/constants" gqlPlayground "zotregistry.io/zot/pkg/debug/gqlplayground" diff --git a/pkg/api/routes_test.go b/pkg/api/routes_test.go index 4634e686..0b1a8339 100644 --- a/pkg/api/routes_test.go +++ b/pkg/api/routes_test.go @@ -15,6 +15,7 @@ import ( "github.com/gorilla/mux" ispec "github.com/opencontainers/image-spec/specs-go/v1" . "github.com/smartystreets/goconvey/convey" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" diff --git a/pkg/api/session.go b/pkg/api/session.go index ac950740..f7dd5a91 100644 --- a/pkg/api/session.go +++ b/pkg/api/session.go @@ -9,6 +9,7 @@ import ( "github.com/didip/tollbooth/v6" "github.com/gorilla/mux" + "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" ) diff --git a/pkg/cli/client_elevated_test.go b/pkg/cli/client_elevated_test.go index 2354f739..8833d940 100644 --- a/pkg/cli/client_elevated_test.go +++ b/pkg/cli/client_elevated_test.go @@ -17,6 +17,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" diff --git a/pkg/cli/client_test.go b/pkg/cli/client_test.go index f758f208..2444d577 100644 --- a/pkg/cli/client_test.go +++ b/pkg/cli/client_test.go @@ -16,6 +16,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" diff --git a/pkg/cli/config_cmd.go b/pkg/cli/config_cmd.go index b94547b4..cbf6d9b1 100644 --- a/pkg/cli/config_cmd.go +++ b/pkg/cli/config_cmd.go @@ -14,6 +14,7 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/spf13/cobra" + zerr "zotregistry.io/zot/errors" ) diff --git a/pkg/cli/config_cmd_test.go b/pkg/cli/config_cmd_test.go index 6f5d3c01..0b40429f 100644 --- a/pkg/cli/config_cmd_test.go +++ b/pkg/cli/config_cmd_test.go @@ -11,6 +11,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + zotErrors "zotregistry.io/zot/errors" ) diff --git a/pkg/cli/config_reloader.go b/pkg/cli/config_reloader.go index 62fb907b..f6dddc5b 100644 --- a/pkg/cli/config_reloader.go +++ b/pkg/cli/config_reloader.go @@ -5,6 +5,7 @@ import ( "github.com/fsnotify/fsnotify" "github.com/rs/zerolog/log" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" ) diff --git a/pkg/cli/config_reloader_test.go b/pkg/cli/config_reloader_test.go index 30d3ad44..27e3ccc4 100644 --- a/pkg/cli/config_reloader_test.go +++ b/pkg/cli/config_reloader_test.go @@ -9,6 +9,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "golang.org/x/crypto/bcrypt" + "zotregistry.io/zot/pkg/cli" "zotregistry.io/zot/pkg/test" ) diff --git a/pkg/cli/cve_cmd.go b/pkg/cli/cve_cmd.go index 416a2336..4b74c476 100644 --- a/pkg/cli/cve_cmd.go +++ b/pkg/cli/cve_cmd.go @@ -14,6 +14,7 @@ import ( "github.com/briandowns/spinner" "github.com/spf13/cobra" "gopkg.in/resty.v1" + zotErrors "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api/constants" ) diff --git a/pkg/cli/cve_cmd_test.go b/pkg/cli/cve_cmd_test.go index 5144f23a..6c4796c5 100644 --- a/pkg/cli/cve_cmd_test.go +++ b/pkg/cli/cve_cmd_test.go @@ -17,6 +17,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "github.com/spf13/cobra" "gopkg.in/resty.v1" + zotErrors "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" diff --git a/pkg/cli/extensions_test.go b/pkg/cli/extensions_test.go index 84ecbc0e..c39343a9 100644 --- a/pkg/cli/extensions_test.go +++ b/pkg/cli/extensions_test.go @@ -14,6 +14,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/cli" . "zotregistry.io/zot/pkg/test" ) diff --git a/pkg/cli/image_cmd.go b/pkg/cli/image_cmd.go index b00058f3..0afdcfcf 100644 --- a/pkg/cli/image_cmd.go +++ b/pkg/cli/image_cmd.go @@ -11,6 +11,7 @@ import ( "github.com/briandowns/spinner" "github.com/spf13/cobra" + zotErrors "zotregistry.io/zot/errors" ) diff --git a/pkg/cli/image_cmd_test.go b/pkg/cli/image_cmd_test.go index 6a23b8a1..c2a77084 100644 --- a/pkg/cli/image_cmd_test.go +++ b/pkg/cli/image_cmd_test.go @@ -25,6 +25,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "github.com/spf13/cobra" "gopkg.in/resty.v1" + zotErrors "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" diff --git a/pkg/cli/repo_cmd.go b/pkg/cli/repo_cmd.go index 2df455a8..1c7d578a 100644 --- a/pkg/cli/repo_cmd.go +++ b/pkg/cli/repo_cmd.go @@ -9,6 +9,7 @@ import ( "github.com/briandowns/spinner" "github.com/spf13/cobra" + zotErrors "zotregistry.io/zot/errors" ) diff --git a/pkg/cli/root.go b/pkg/cli/root.go index bb2b9855..3411db4d 100644 --- a/pkg/cli/root.go +++ b/pkg/cli/root.go @@ -15,6 +15,7 @@ import ( "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" diff --git a/pkg/cli/root_test.go b/pkg/cli/root_test.go index 60b1025d..f46f613d 100644 --- a/pkg/cli/root_test.go +++ b/pkg/cli/root_test.go @@ -11,6 +11,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/cli" diff --git a/pkg/cli/searcher.go b/pkg/cli/searcher.go index f95fdd99..58c4e71d 100644 --- a/pkg/cli/searcher.go +++ b/pkg/cli/searcher.go @@ -13,6 +13,7 @@ import ( "time" "github.com/briandowns/spinner" + zotErrors "zotregistry.io/zot/errors" ) @@ -638,14 +639,12 @@ type spinnerState struct { enabled bool } -//nolint func (spinner *spinnerState) startSpinner() { if spinner.enabled { spinner.spinner.Start() } } -//nolint func (spinner *spinnerState) stopSpinner() { if spinner.enabled && spinner.spinner.Active() { spinner.spinner.Stop() diff --git a/pkg/cli/service.go b/pkg/cli/service.go index 1f9668c8..da28a843 100644 --- a/pkg/cli/service.go +++ b/pkg/cli/service.go @@ -17,6 +17,7 @@ import ( jsoniter "github.com/json-iterator/go" "github.com/olekukonko/tablewriter" "gopkg.in/yaml.v2" + zotErrors "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api/constants" ) diff --git a/pkg/cli/stress_test.go b/pkg/cli/stress_test.go index d7d8fb73..41f65762 100644 --- a/pkg/cli/stress_test.go +++ b/pkg/cli/stress_test.go @@ -14,6 +14,7 @@ import ( "time" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/cli" diff --git a/pkg/common/common_test.go b/pkg/common/common_test.go index fe3be53f..44bf28d5 100644 --- a/pkg/common/common_test.go +++ b/pkg/common/common_test.go @@ -4,6 +4,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/common" ) diff --git a/pkg/compliance/v1_0_0/check.go b/pkg/compliance/v1_0_0/check.go index d5323e2b..53a87fd2 100644 --- a/pkg/compliance/v1_0_0/check.go +++ b/pkg/compliance/v1_0_0/check.go @@ -20,6 +20,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "github.com/smartystreets/goconvey/convey/reporting" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/constants" "zotregistry.io/zot/pkg/compliance" diff --git a/pkg/compliance/v1_0_0/check_test.go b/pkg/compliance/v1_0_0/check_test.go index bd88c3b4..b02c51fa 100644 --- a/pkg/compliance/v1_0_0/check_test.go +++ b/pkg/compliance/v1_0_0/check_test.go @@ -8,6 +8,7 @@ import ( "time" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/compliance" diff --git a/pkg/debug/gqlplayground/gqlplayground.go b/pkg/debug/gqlplayground/gqlplayground.go index c88504ee..61bcc80e 100644 --- a/pkg/debug/gqlplayground/gqlplayground.go +++ b/pkg/debug/gqlplayground/gqlplayground.go @@ -9,6 +9,7 @@ import ( "net/http" "github.com/gorilla/mux" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" debugCst "zotregistry.io/zot/pkg/debug/constants" diff --git a/pkg/debug/gqlplayground/gqlplayground_disabled.go b/pkg/debug/gqlplayground/gqlplayground_disabled.go index d266ccce..b1cf4367 100644 --- a/pkg/debug/gqlplayground/gqlplayground_disabled.go +++ b/pkg/debug/gqlplayground/gqlplayground_disabled.go @@ -5,6 +5,7 @@ package debug import ( "github.com/gorilla/mux" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/debug/swagger/swagger.go b/pkg/debug/swagger/swagger.go index a1a3a378..1087a650 100644 --- a/pkg/debug/swagger/swagger.go +++ b/pkg/debug/swagger/swagger.go @@ -10,6 +10,7 @@ package debug import ( "github.com/gorilla/mux" httpSwagger "github.com/swaggo/http-swagger" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/log" //nolint:goimports // as required by swaggo. diff --git a/pkg/debug/swagger/swagger_disabled.go b/pkg/debug/swagger/swagger_disabled.go index 239968d2..c58fe4f4 100644 --- a/pkg/debug/swagger/swagger_disabled.go +++ b/pkg/debug/swagger/swagger_disabled.go @@ -9,6 +9,7 @@ package debug import ( "github.com/gorilla/mux" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/log" //nolint:goimports // as required by swaggo. diff --git a/pkg/exporter/api/controller_test.go b/pkg/exporter/api/controller_test.go index 45f5a88d..8b9fcfa2 100644 --- a/pkg/exporter/api/controller_test.go +++ b/pkg/exporter/api/controller_test.go @@ -20,6 +20,7 @@ import ( dto "github.com/prometheus/client_model/go" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + zotapi "zotregistry.io/zot/pkg/api" zotcfg "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/exporter/api" diff --git a/pkg/exporter/api/exporter.go b/pkg/exporter/api/exporter.go index 46b5b11e..6e159838 100644 --- a/pkg/exporter/api/exporter.go +++ b/pkg/exporter/api/exporter.go @@ -14,6 +14,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" + "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" ) diff --git a/pkg/exporter/cli/cli.go b/pkg/exporter/cli/cli.go index 5e80ba1c..24285556 100644 --- a/pkg/exporter/cli/cli.go +++ b/pkg/exporter/cli/cli.go @@ -8,6 +8,7 @@ import ( "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/exporter/api" ) diff --git a/pkg/extensions/extension_metrics.go b/pkg/extensions/extension_metrics.go index 9941984d..28c54b74 100644 --- a/pkg/extensions/extension_metrics.go +++ b/pkg/extensions/extension_metrics.go @@ -6,6 +6,7 @@ package extensions import ( "github.com/gorilla/mux" "github.com/prometheus/client_golang/prometheus/promhttp" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/extensions/extension_metrics_disabled.go b/pkg/extensions/extension_metrics_disabled.go index 62bc77e7..9d26781f 100644 --- a/pkg/extensions/extension_metrics_disabled.go +++ b/pkg/extensions/extension_metrics_disabled.go @@ -5,6 +5,7 @@ package extensions import ( "github.com/gorilla/mux" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/extensions/extension_search.go b/pkg/extensions/extension_search.go index d0c12cb2..da8b9b9c 100644 --- a/pkg/extensions/extension_search.go +++ b/pkg/extensions/extension_search.go @@ -9,6 +9,7 @@ import ( gqlHandler "github.com/99designs/gqlgen/graphql/handler" "github.com/gorilla/mux" distext "github.com/opencontainers/distribution-spec/specs-go/v1/extensions" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" "zotregistry.io/zot/pkg/extensions/search" diff --git a/pkg/extensions/extension_search_disabled.go b/pkg/extensions/extension_search_disabled.go index f7f784d8..fd522799 100644 --- a/pkg/extensions/extension_search_disabled.go +++ b/pkg/extensions/extension_search_disabled.go @@ -6,6 +6,7 @@ package extensions import ( "github.com/gorilla/mux" distext "github.com/opencontainers/distribution-spec/specs-go/v1/extensions" + "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/extensions/extensions_test.go b/pkg/extensions/extensions_test.go index e78169b7..3ee80643 100644 --- a/pkg/extensions/extensions_test.go +++ b/pkg/extensions/extensions_test.go @@ -9,6 +9,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" extconf "zotregistry.io/zot/pkg/extensions/config" diff --git a/pkg/extensions/lint/lint-disabled.go b/pkg/extensions/lint/lint-disabled.go index 33e1dc7e..3c33bc39 100644 --- a/pkg/extensions/lint/lint-disabled.go +++ b/pkg/extensions/lint/lint-disabled.go @@ -5,6 +5,7 @@ package lint import ( godigest "github.com/opencontainers/go-digest" + "zotregistry.io/zot/pkg/storage" ) diff --git a/pkg/extensions/lint/lint.go b/pkg/extensions/lint/lint.go index fe315f63..bde2bd59 100644 --- a/pkg/extensions/lint/lint.go +++ b/pkg/extensions/lint/lint.go @@ -8,6 +8,7 @@ import ( godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" + "zotregistry.io/zot/pkg/extensions/config" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/extensions/lint/lint_test.go b/pkg/extensions/lint/lint_test.go index 4dd4340d..9b4a0e23 100644 --- a/pkg/extensions/lint/lint_test.go +++ b/pkg/extensions/lint/lint_test.go @@ -16,6 +16,7 @@ import ( ispec "github.com/opencontainers/image-spec/specs-go/v1" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" extconf "zotregistry.io/zot/pkg/extensions/config" diff --git a/pkg/extensions/monitoring/extension.go b/pkg/extensions/monitoring/extension.go index 3d02141b..e002c7ba 100644 --- a/pkg/extensions/monitoring/extension.go +++ b/pkg/extensions/monitoring/extension.go @@ -10,6 +10,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/log" ) diff --git a/pkg/extensions/monitoring/monitoring_test.go b/pkg/extensions/monitoring/monitoring_test.go index 92b3190c..b9e02cba 100644 --- a/pkg/extensions/monitoring/monitoring_test.go +++ b/pkg/extensions/monitoring/monitoring_test.go @@ -12,6 +12,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" extconf "zotregistry.io/zot/pkg/extensions/config" diff --git a/pkg/extensions/scrub/scrub_test.go b/pkg/extensions/scrub/scrub_test.go index bcdad51d..d52985df 100644 --- a/pkg/extensions/scrub/scrub_test.go +++ b/pkg/extensions/scrub/scrub_test.go @@ -14,6 +14,7 @@ import ( "github.com/opencontainers/go-digest" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" extconf "zotregistry.io/zot/pkg/extensions/config" diff --git a/pkg/extensions/search/common/common.go b/pkg/extensions/search/common/common.go index 96c808cb..90766896 100644 --- a/pkg/extensions/search/common/common.go +++ b/pkg/extensions/search/common/common.go @@ -7,6 +7,7 @@ import ( "time" ispec "github.com/opencontainers/image-spec/specs-go/v1" + "zotregistry.io/zot/pkg/storage" ) diff --git a/pkg/extensions/search/common/common_test.go b/pkg/extensions/search/common/common_test.go index 0b90c371..23df8cd4 100644 --- a/pkg/extensions/search/common/common_test.go +++ b/pkg/extensions/search/common/common_test.go @@ -27,6 +27,7 @@ import ( "github.com/sigstore/cosign/cmd/cosign/cli/sign" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" diff --git a/pkg/extensions/search/common/oci_layout.go b/pkg/extensions/search/common/oci_layout.go index 3e513a3f..dbdd650d 100644 --- a/pkg/extensions/search/common/oci_layout.go +++ b/pkg/extensions/search/common/oci_layout.go @@ -12,6 +12,7 @@ import ( notreg "github.com/notaryproject/notation-go/registry" godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/extensions/search/cve/cve.go b/pkg/extensions/search/cve/cve.go index c99126fa..79206445 100644 --- a/pkg/extensions/search/cve/cve.go +++ b/pkg/extensions/search/cve/cve.go @@ -6,6 +6,7 @@ import ( v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" + "zotregistry.io/zot/pkg/extensions/search/common" cvemodel "zotregistry.io/zot/pkg/extensions/search/cve/model" "zotregistry.io/zot/pkg/extensions/search/cve/trivy" diff --git a/pkg/extensions/search/cve/cve_test.go b/pkg/extensions/search/cve/cve_test.go index 70845d47..e4594f9a 100644 --- a/pkg/extensions/search/cve/cve_test.go +++ b/pkg/extensions/search/cve/cve_test.go @@ -20,6 +20,7 @@ import ( ispec "github.com/opencontainers/image-spec/specs-go/v1" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" diff --git a/pkg/extensions/search/cve/trivy/scanner.go b/pkg/extensions/search/cve/trivy/scanner.go index 65760b6f..093ccc91 100644 --- a/pkg/extensions/search/cve/trivy/scanner.go +++ b/pkg/extensions/search/cve/trivy/scanner.go @@ -13,6 +13,7 @@ import ( regTypes "github.com/google/go-containerregistry/pkg/v1/types" ispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/urfave/cli/v2" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/search/common" cvemodel "zotregistry.io/zot/pkg/extensions/search/cve/model" diff --git a/pkg/extensions/search/cve/trivy/scanner_internal_test.go b/pkg/extensions/search/cve/trivy/scanner_internal_test.go index b28f7eee..cffe18f9 100644 --- a/pkg/extensions/search/cve/trivy/scanner_internal_test.go +++ b/pkg/extensions/search/cve/trivy/scanner_internal_test.go @@ -10,6 +10,7 @@ import ( godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api/config" extconf "zotregistry.io/zot/pkg/extensions/config" "zotregistry.io/zot/pkg/extensions/monitoring" diff --git a/pkg/extensions/search/digest/digest.go b/pkg/extensions/search/digest/digest.go index 69083c71..1a09831a 100644 --- a/pkg/extensions/search/digest/digest.go +++ b/pkg/extensions/search/digest/digest.go @@ -6,6 +6,7 @@ import ( v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" + "zotregistry.io/zot/pkg/extensions/search/common" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/extensions/search/digest/digest_test.go b/pkg/extensions/search/digest/digest_test.go index 594c45da..62552c0c 100644 --- a/pkg/extensions/search/digest/digest_test.go +++ b/pkg/extensions/search/digest/digest_test.go @@ -14,6 +14,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" diff --git a/pkg/extensions/search/resolver.go b/pkg/extensions/search/resolver.go index 2d339330..d1d1cae9 100644 --- a/pkg/extensions/search/resolver.go +++ b/pkg/extensions/search/resolver.go @@ -12,17 +12,18 @@ import ( "strings" "github.com/99designs/gqlgen/graphql" - glob "github.com/bmatcuk/doublestar/v4" //nolint:gci - v1 "github.com/google/go-containerregistry/pkg/v1" //nolint:gci + glob "github.com/bmatcuk/doublestar/v4" + v1 "github.com/google/go-containerregistry/pkg/v1" godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/vektah/gqlparser/v2/gqlerror" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/search/common" cveinfo "zotregistry.io/zot/pkg/extensions/search/cve" digestinfo "zotregistry.io/zot/pkg/extensions/search/digest" "zotregistry.io/zot/pkg/extensions/search/gql_generated" - "zotregistry.io/zot/pkg/log" //nolint: gci + "zotregistry.io/zot/pkg/log" localCtx "zotregistry.io/zot/pkg/requestcontext" "zotregistry.io/zot/pkg/storage" ) // THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES. diff --git a/pkg/extensions/search/resolver_test.go b/pkg/extensions/search/resolver_test.go index 3f976364..40ce5df0 100644 --- a/pkg/extensions/search/resolver_test.go +++ b/pkg/extensions/search/resolver_test.go @@ -14,6 +14,7 @@ import ( ispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/extensions/search/common" "zotregistry.io/zot/pkg/log" diff --git a/pkg/extensions/sync/on_demand.go b/pkg/extensions/sync/on_demand.go index 9ebdaf01..01387c2d 100644 --- a/pkg/extensions/sync/on_demand.go +++ b/pkg/extensions/sync/on_demand.go @@ -14,6 +14,7 @@ import ( "github.com/containers/image/v5/signature" "github.com/containers/image/v5/types" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" ) diff --git a/pkg/extensions/sync/signatures.go b/pkg/extensions/sync/signatures.go index c4dfb2af..ae920811 100644 --- a/pkg/extensions/sync/signatures.go +++ b/pkg/extensions/sync/signatures.go @@ -13,6 +13,7 @@ import ( artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" "github.com/sigstore/cosign/pkg/oci/remote" "gopkg.in/resty.v1" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api/constants" "zotregistry.io/zot/pkg/log" diff --git a/pkg/extensions/sync/sync.go b/pkg/extensions/sync/sync.go index 481a52ad..279e0956 100644 --- a/pkg/extensions/sync/sync.go +++ b/pkg/extensions/sync/sync.go @@ -20,6 +20,7 @@ import ( "github.com/containers/image/v5/types" ispec "github.com/opencontainers/image-spec/specs-go/v1" "gopkg.in/resty.v1" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/api/constants" "zotregistry.io/zot/pkg/log" diff --git a/pkg/extensions/sync/sync_disabled_test.go b/pkg/extensions/sync/sync_disabled_test.go index 2d2f5156..6edca759 100644 --- a/pkg/extensions/sync/sync_disabled_test.go +++ b/pkg/extensions/sync/sync_disabled_test.go @@ -10,6 +10,7 @@ import ( . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" extconf "zotregistry.io/zot/pkg/extensions/config" diff --git a/pkg/extensions/sync/sync_internal_test.go b/pkg/extensions/sync/sync_internal_test.go index b39445cc..72444491 100644 --- a/pkg/extensions/sync/sync_internal_test.go +++ b/pkg/extensions/sync/sync_internal_test.go @@ -21,6 +21,7 @@ import ( "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" diff --git a/pkg/extensions/sync/sync_test.go b/pkg/extensions/sync/sync_test.go index ea40e7c5..7b81d140 100644 --- a/pkg/extensions/sync/sync_test.go +++ b/pkg/extensions/sync/sync_test.go @@ -35,6 +35,7 @@ import ( "github.com/sigstore/cosign/pkg/oci/remote" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" diff --git a/pkg/extensions/sync/utils.go b/pkg/extensions/sync/utils.go index 34972cdf..88d57c2e 100644 --- a/pkg/extensions/sync/utils.go +++ b/pkg/extensions/sync/utils.go @@ -21,6 +21,7 @@ import ( artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" "github.com/sigstore/cosign/pkg/oci/static" "gopkg.in/resty.v1" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/common" "zotregistry.io/zot/pkg/extensions/monitoring" diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index f4a1bffb..a791ef99 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -20,6 +20,7 @@ import ( "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/api/constants" diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go index 290d3934..ae690512 100644 --- a/pkg/scheduler/scheduler_test.go +++ b/pkg/scheduler/scheduler_test.go @@ -9,6 +9,7 @@ import ( "time" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/scheduler" ) diff --git a/pkg/storage/cache.go b/pkg/storage/cache.go index 1416f65a..d31c63d8 100644 --- a/pkg/storage/cache.go +++ b/pkg/storage/cache.go @@ -7,6 +7,7 @@ import ( "time" "go.etcd.io/bbolt" + "zotregistry.io/zot/errors" zlog "zotregistry.io/zot/pkg/log" ) diff --git a/pkg/storage/cache_test.go b/pkg/storage/cache_test.go index 6824ec06..65f2d733 100644 --- a/pkg/storage/cache_test.go +++ b/pkg/storage/cache_test.go @@ -5,6 +5,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/storage/common.go b/pkg/storage/common.go index 8bf60189..e46ba364 100644 --- a/pkg/storage/common.go +++ b/pkg/storage/common.go @@ -11,6 +11,7 @@ import ( artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" "github.com/rs/zerolog" "github.com/sigstore/cosign/pkg/oci/remote" + zerr "zotregistry.io/zot/errors" ) diff --git a/pkg/storage/common_test.go b/pkg/storage/common_test.go index ec54ec80..0f6fa88f 100644 --- a/pkg/storage/common_test.go +++ b/pkg/storage/common_test.go @@ -10,6 +10,7 @@ import ( ispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/storage/local/local.go b/pkg/storage/local/local.go index 45dc2655..538001c1 100644 --- a/pkg/storage/local/local.go +++ b/pkg/storage/local/local.go @@ -25,6 +25,7 @@ import ( "github.com/opencontainers/umoci/oci/casext" artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" "github.com/rs/zerolog" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/monitoring" zlog "zotregistry.io/zot/pkg/log" diff --git a/pkg/storage/local/local_elevated_test.go b/pkg/storage/local/local_elevated_test.go index 62028db4..43416f8a 100644 --- a/pkg/storage/local/local_elevated_test.go +++ b/pkg/storage/local/local_elevated_test.go @@ -15,6 +15,7 @@ import ( godigest "github.com/opencontainers/go-digest" "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/storage/local/local_test.go b/pkg/storage/local/local_test.go index b76e035c..72ef8c7c 100644 --- a/pkg/storage/local/local_test.go +++ b/pkg/storage/local/local_test.go @@ -23,6 +23,7 @@ import ( artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" diff --git a/pkg/storage/s3/s3.go b/pkg/storage/s3/s3.go index c8e28d1b..dc31ccea 100644 --- a/pkg/storage/s3/s3.go +++ b/pkg/storage/s3/s3.go @@ -23,6 +23,7 @@ import ( ispec "github.com/opencontainers/image-spec/specs-go/v1" artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" "github.com/rs/zerolog" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/monitoring" zlog "zotregistry.io/zot/pkg/log" diff --git a/pkg/storage/s3/s3_test.go b/pkg/storage/s3/s3_test.go index defcf9b9..e35ddfa7 100644 --- a/pkg/storage/s3/s3_test.go +++ b/pkg/storage/s3/s3_test.go @@ -23,6 +23,7 @@ import ( "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + zerr "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" diff --git a/pkg/storage/scrub.go b/pkg/storage/scrub.go index 72c2e5c0..641d9d97 100644 --- a/pkg/storage/scrub.go +++ b/pkg/storage/scrub.go @@ -15,6 +15,7 @@ import ( ispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/umoci" "github.com/opencontainers/umoci/oci/casext" + "zotregistry.io/zot/errors" ) diff --git a/pkg/storage/scrub_test.go b/pkg/storage/scrub_test.go index 02f5e985..ff2cb7c9 100644 --- a/pkg/storage/scrub_test.go +++ b/pkg/storage/scrub_test.go @@ -14,6 +14,7 @@ import ( godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go index d2577a51..ea6c47ed 100644 --- a/pkg/storage/storage.go +++ b/pkg/storage/storage.go @@ -6,6 +6,7 @@ import ( "github.com/opencontainers/go-digest" artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" + "zotregistry.io/zot/pkg/scheduler" ) diff --git a/pkg/storage/storage_test.go b/pkg/storage/storage_test.go index abb7c80f..adff4d56 100644 --- a/pkg/storage/storage_test.go +++ b/pkg/storage/storage_test.go @@ -24,6 +24,7 @@ import ( "github.com/rs/zerolog" . "github.com/smartystreets/goconvey/convey" "gopkg.in/resty.v1" + "zotregistry.io/zot/pkg/extensions/monitoring" "zotregistry.io/zot/pkg/log" "zotregistry.io/zot/pkg/storage" diff --git a/pkg/test/common_test.go b/pkg/test/common_test.go index 3f00ae50..843009e3 100644 --- a/pkg/test/common_test.go +++ b/pkg/test/common_test.go @@ -14,6 +14,7 @@ import ( "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/api" "zotregistry.io/zot/pkg/api/config" "zotregistry.io/zot/pkg/test" diff --git a/pkg/test/inject_test.go b/pkg/test/inject_test.go index b8525a2c..0c8afefa 100644 --- a/pkg/test/inject_test.go +++ b/pkg/test/inject_test.go @@ -10,6 +10,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/pkg/test" ) diff --git a/pkg/test/mocks/image_store_mock.go b/pkg/test/mocks/image_store_mock.go index 3872e69c..3860326a 100644 --- a/pkg/test/mocks/image_store_mock.go +++ b/pkg/test/mocks/image_store_mock.go @@ -6,6 +6,7 @@ import ( "github.com/opencontainers/go-digest" artifactspec "github.com/oras-project/artifacts-spec/specs-go/v1" + "zotregistry.io/zot/pkg/scheduler" ) diff --git a/pkg/test/mocks/lint_mock.go b/pkg/test/mocks/lint_mock.go index 0fe112af..7adf2064 100644 --- a/pkg/test/mocks/lint_mock.go +++ b/pkg/test/mocks/lint_mock.go @@ -2,6 +2,7 @@ package mocks import ( godigest "github.com/opencontainers/go-digest" + "zotregistry.io/zot/pkg/storage" ) diff --git a/pkg/test/mocks/oci_mock.go b/pkg/test/mocks/oci_mock.go index 6bdb123a..22de6b6d 100644 --- a/pkg/test/mocks/oci_mock.go +++ b/pkg/test/mocks/oci_mock.go @@ -4,6 +4,7 @@ import ( v1 "github.com/google/go-containerregistry/pkg/v1" godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" + "zotregistry.io/zot/pkg/extensions/search/common" ) diff --git a/swagger/docs.go b/swagger/docs.go index bb18e4ee..3cf229fd 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -838,7 +838,6 @@ func New() *s { return &s{} } - func (s *s) ReadDoc() string { sInfo := SwaggerInfo sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) diff --git a/swagger/docs_test.go b/swagger/docs_test.go index 4ce414a6..72fb2b3d 100644 --- a/swagger/docs_test.go +++ b/swagger/docs_test.go @@ -4,6 +4,7 @@ import ( "testing" . "github.com/smartystreets/goconvey/convey" + "zotregistry.io/zot/swagger" )