diff --git a/.golangci.yaml b/.golangci.yaml index b00fb256..9f40472c 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -8,6 +8,7 @@ linters: - bodyclose - errorlint - ginkgolinter + - gci - gofmt - goimports - gosec @@ -50,9 +51,10 @@ linters-settings: gci: sections: - standard + - dot - default - prefix(github.com/operator-framework) - - prefix(github.com/operator-framework/operator-controller) + - prefix(github.com/operator-framework/rukpak) custom-order: true output: diff --git a/cmd/core/main.go b/cmd/core/main.go index 3d0c3c19..5890f46d 100644 --- a/cmd/core/main.go +++ b/cmd/core/main.go @@ -26,7 +26,6 @@ import ( "os" "github.com/gorilla/handlers" - helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client" "github.com/spf13/pflag" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/labels" @@ -43,6 +42,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/metrics/server" + helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client" + rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2" "github.com/operator-framework/rukpak/internal/controllers/bundledeployment" "github.com/operator-framework/rukpak/internal/finalizer" diff --git a/cmd/helm/main.go b/cmd/helm/main.go index d51ccc4d..4200f9a3 100644 --- a/cmd/helm/main.go +++ b/cmd/helm/main.go @@ -24,7 +24,6 @@ import ( "net/url" "os" - helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -39,6 +38,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/metrics/server" + helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client" + rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2" "github.com/operator-framework/rukpak/internal/controllers/bundledeployment" "github.com/operator-framework/rukpak/internal/finalizer" diff --git a/internal/controllers/bundledeployment/bundledeployment.go b/internal/controllers/bundledeployment/bundledeployment.go index 854a375c..78d68efd 100644 --- a/internal/controllers/bundledeployment/bundledeployment.go +++ b/internal/controllers/bundledeployment/bundledeployment.go @@ -9,7 +9,6 @@ import ( "strings" "sync" - helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" @@ -37,6 +36,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/source" + helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client" + rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2" "github.com/operator-framework/rukpak/internal/healthchecks" helmpredicate "github.com/operator-framework/rukpak/internal/helm-operator-plugins/predicate" diff --git a/internal/controllers/bundledeployment/bundledeployment_test.go b/internal/controllers/bundledeployment/bundledeployment_test.go index a9a9c929..36fae329 100644 --- a/internal/controllers/bundledeployment/bundledeployment_test.go +++ b/internal/controllers/bundledeployment/bundledeployment_test.go @@ -7,6 +7,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "helm.sh/helm/v3/pkg/postrender" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/convert/registryv1.go b/internal/convert/registryv1.go index 53864eb7..88e13f60 100644 --- a/internal/convert/registryv1.go +++ b/internal/convert/registryv1.go @@ -11,8 +11,6 @@ import ( "testing/fstest" "time" - "github.com/operator-framework/api/pkg/operators/v1alpha1" - registrybundle "github.com/operator-framework/operator-registry/pkg/lib/bundle" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -25,6 +23,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" + "github.com/operator-framework/api/pkg/operators/v1alpha1" + registrybundle "github.com/operator-framework/operator-registry/pkg/lib/bundle" + registry "github.com/operator-framework/rukpak/internal/operator-registry" "github.com/operator-framework/rukpak/internal/util" ) diff --git a/internal/convert/registryv1_test.go b/internal/convert/registryv1_test.go index 30b45ea9..fdaf5619 100644 --- a/internal/convert/registryv1_test.go +++ b/internal/convert/registryv1_test.go @@ -5,7 +5,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/operator-framework/api/pkg/operators/v1alpha1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" schedulingv1 "k8s.io/api/scheduling/v1" @@ -14,6 +14,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/operator-framework/api/pkg/operators/v1alpha1" ) func TestRegistryV1Converter(t *testing.T) { diff --git a/internal/storage/http_test.go b/internal/storage/http_test.go index ae5ae7a2..97b5b5c2 100644 --- a/internal/storage/http_test.go +++ b/internal/storage/http_test.go @@ -14,6 +14,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" diff --git a/internal/storage/localdir_test.go b/internal/storage/localdir_test.go index 200fb70a..d8a6d927 100644 --- a/internal/storage/localdir_test.go +++ b/internal/storage/localdir_test.go @@ -13,6 +13,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/rand" diff --git a/internal/storage/storage_test.go b/internal/storage/storage_test.go index 6daf94c6..66760ace 100644 --- a/internal/storage/storage_test.go +++ b/internal/storage/storage_test.go @@ -10,6 +10,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" diff --git a/test/e2e/api_validation_test.go b/test/e2e/api_validation_test.go index 48d707d6..b12cecad 100644 --- a/test/e2e/api_validation_test.go +++ b/test/e2e/api_validation_test.go @@ -6,6 +6,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" diff --git a/test/e2e/crdvalidator_test.go b/test/e2e/crdvalidator_test.go index a83b091e..887cb01c 100644 --- a/test/e2e/crdvalidator_test.go +++ b/test/e2e/crdvalidator_test.go @@ -5,6 +5,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 83abf967..95fecfd4 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -6,7 +6,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - operatorsv1 "github.com/operator-framework/api/pkg/operators/v1" + appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -20,6 +20,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" + operatorsv1 "github.com/operator-framework/api/pkg/operators/v1" + rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2" ) diff --git a/test/e2e/helm_provisioner_test.go b/test/e2e/helm_provisioner_test.go index 7777b9ce..ac9c6504 100644 --- a/test/e2e/helm_provisioner_test.go +++ b/test/e2e/helm_provisioner_test.go @@ -5,6 +5,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" diff --git a/test/e2e/plain_provisioner_test.go b/test/e2e/plain_provisioner_test.go index a54457de..495897b0 100644 --- a/test/e2e/plain_provisioner_test.go +++ b/test/e2e/plain_provisioner_test.go @@ -14,6 +14,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" diff --git a/test/e2e/registry_provisioner_test.go b/test/e2e/registry_provisioner_test.go index 29250c1b..a0f452f3 100644 --- a/test/e2e/registry_provisioner_test.go +++ b/test/e2e/registry_provisioner_test.go @@ -6,6 +6,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/test/e2e/webhook_test.go b/test/e2e/webhook_test.go index ab767e5f..571922e4 100644 --- a/test/e2e/webhook_test.go +++ b/test/e2e/webhook_test.go @@ -5,6 +5,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"