From 955fc0aa1c6ad6ae3d3f973ed83bc4ad799a8aa3 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Mon, 16 Sep 2024 09:47:06 -0700 Subject: [PATCH] Fix formatting Signed-off-by: Tamal Saha --- Makefile | 2 +- test/e2e/e2e_suite_test.go | 7 +++---- test/e2e/framework/approval_policy.go | 3 ++- test/e2e/framework/cluster_maintenance_window.go | 3 ++- test/e2e/framework/crd.go | 3 ++- test/e2e/framework/database.go | 5 ++--- test/e2e/framework/framework.go | 3 +-- test/e2e/framework/maintenance_window.go | 7 ++++--- test/e2e/framework/parallelism.go | 5 ++--- test/e2e/framework/recommendation.go | 5 ++--- test/e2e/recommendation_test.go | 10 ++++------ 11 files changed, 25 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 874e73a6..1532cc43 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ endif ### These variables should not need tweaking. ### -SRC_PKGS := apis cmd pkg # directories which hold app source excluding tests (not vendored) +SRC_PKGS := apis cmd crds hack pkg test # directories which hold app source excluding tests (not vendored) SRC_DIRS := $(SRC_PKGS) # directories which hold app source (not vendored) DOCKER_PLATFORMS := linux/amd64 linux/arm64 diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 561798be..acbccf1f 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -22,6 +22,9 @@ import ( "path/filepath" "testing" + api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + "kubeops.dev/supervisor/test/e2e/framework" + . "github.com/onsi/ginkgo/v2" "github.com/onsi/ginkgo/v2/types" . "github.com/onsi/gomega" @@ -32,13 +35,10 @@ import ( "k8s.io/client-go/util/homedir" kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" - "kubeops.dev/supervisor/test/e2e/framework" ctrl "sigs.k8s.io/controller-runtime" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - //+kubebuilder:scaffold:imports ) var ( @@ -103,7 +103,6 @@ var _ = BeforeSuite(func() { By("Ensuring CRDs") root.EnsureCRD().Should(Succeed()) - }, 60) var _ = AfterSuite(func() { diff --git a/test/e2e/framework/approval_policy.go b/test/e2e/framework/approval_policy.go index aa4514aa..00e1d585 100644 --- a/test/e2e/framework/approval_policy.go +++ b/test/e2e/framework/approval_policy.go @@ -20,11 +20,12 @@ import ( "context" "time" + api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + "gomodules.xyz/x/crypto/rand" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" kmapi "kmodules.xyz/client-go/api/v1" - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/e2e/framework/cluster_maintenance_window.go b/test/e2e/framework/cluster_maintenance_window.go index b37656d4..0ecf605e 100644 --- a/test/e2e/framework/cluster_maintenance_window.go +++ b/test/e2e/framework/cluster_maintenance_window.go @@ -20,9 +20,10 @@ import ( "context" "time" + api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/e2e/framework/crd.go b/test/e2e/framework/crd.go index 3af38233..4ecd83e1 100644 --- a/test/e2e/framework/crd.go +++ b/test/e2e/framework/crd.go @@ -20,8 +20,9 @@ import ( "fmt" "time" - . "github.com/onsi/gomega" api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + + . "github.com/onsi/gomega" ) func (f *Framework) EnsureCRD() GomegaAsyncAssertion { diff --git a/test/e2e/framework/database.go b/test/e2e/framework/database.go index 1de04d0e..1b65f22e 100644 --- a/test/e2e/framework/database.go +++ b/test/e2e/framework/database.go @@ -20,16 +20,15 @@ import ( "context" "time" - "sigs.k8s.io/controller-runtime/pkg/client" - "gomodules.xyz/pointer" "gomodules.xyz/x/crypto/rand" core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" - kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" "kubedb.dev/apimachinery/apis/kubedb" + kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" + "sigs.k8s.io/controller-runtime/pkg/client" ) func (f *Framework) getDatabaseNamespace() string { diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index f05acb2a..071a2c69 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -20,10 +20,9 @@ import ( "context" "os" - "github.com/jonboulle/clockwork" - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + "github.com/jonboulle/clockwork" "gomodules.xyz/x/crypto/rand" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/test/e2e/framework/maintenance_window.go b/test/e2e/framework/maintenance_window.go index 6c3d82bc..dc4b5414 100644 --- a/test/e2e/framework/maintenance_window.go +++ b/test/e2e/framework/maintenance_window.go @@ -20,11 +20,12 @@ import ( "context" "time" + api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + "gomodules.xyz/x/crypto/rand" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" kmapi "kmodules.xyz/client-go/api/v1" - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -38,8 +39,8 @@ func (f *Framework) CreateDefaultMaintenanceWindow() error { IsDefault: true, Dates: []api.DateWindow{ { - Start: metav1.Time{Time: time.Date(2022, 01, 01, 0, 0, 0, 0, time.UTC)}, - End: metav1.Time{Time: time.Date(2023, 01, 01, 0, 0, 0, 0, time.UTC)}, + Start: metav1.Time{Time: time.Date(2022, 0o1, 0o1, 0, 0, 0, 0, time.UTC)}, + End: metav1.Time{Time: time.Date(2023, 0o1, 0o1, 0, 0, 0, 0, time.UTC)}, }, }, }, diff --git a/test/e2e/framework/parallelism.go b/test/e2e/framework/parallelism.go index 48723b87..e150a53d 100644 --- a/test/e2e/framework/parallelism.go +++ b/test/e2e/framework/parallelism.go @@ -19,11 +19,10 @@ package framework import ( "errors" - "k8s.io/apimachinery/pkg/runtime/schema" + api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/e2e/framework/recommendation.go b/test/e2e/framework/recommendation.go index 17f889ab..e58ed0d1 100644 --- a/test/e2e/framework/recommendation.go +++ b/test/e2e/framework/recommendation.go @@ -22,7 +22,7 @@ import ( "errors" "time" - opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" + api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" "gomodules.xyz/pointer" "gomodules.xyz/x/crypto/rand" @@ -33,7 +33,7 @@ import ( kmapi "kmodules.xyz/client-go/api/v1" kmc "kmodules.xyz/client-go/client" kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -156,7 +156,6 @@ func (f *Framework) createRecommendation(rcmd *api.Recommendation) (*api.Recomme } return true, nil }) - if err != nil { return nil, err } diff --git a/test/e2e/recommendation_test.go b/test/e2e/recommendation_test.go index 141d178b..a9021109 100644 --- a/test/e2e/recommendation_test.go +++ b/test/e2e/recommendation_test.go @@ -20,23 +20,21 @@ import ( "errors" "time" - "gomodules.xyz/pointer" + api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" + "kubeops.dev/supervisor/test/e2e/framework" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "gomodules.xyz/pointer" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kmapi "kmodules.xyz/client-go/api/v1" kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" - api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" - "kubeops.dev/supervisor/test/e2e/framework" "sigs.k8s.io/controller-runtime/pkg/client" ) var _ = Describe("Supervisor E2E Testing", func() { - var ( - f *framework.Invocation - ) + var f *framework.Invocation var ( createNewStandaloneMongoDB = func() *kubedbv1.MongoDB {