diff --git a/.golangci.yaml b/.golangci.yaml index bed92f3e4..48f1b35ad 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -24,11 +24,21 @@ linters: - unused - varcheck - importas + - gci linters-settings: importas: + no-unaliased: true alias: - pkg: k8s.io/api/core/v1 alias: core - pkg: k8s.io/apimachinery/pkg/apis/meta/v1 alias: meta + - pkg: k8s.io/client-go/kubernetes/typed/core/v1 + alias: typedCore + gci: + sections: + - standard + - default + - prefix(github.com/arangodb) + - prefix(github.com/arangodb/kube-arangodb) diff --git a/Makefile b/Makefile index 06a76b97a..df15b61bf 100644 --- a/Makefile +++ b/Makefile @@ -155,8 +155,9 @@ ifdef VERBOSE TESTVERBOSEOPTIONS := -v endif -EXCLUDE_DIRS := vendor .gobuild deps tools -SOURCES_QUERY := find ./ -type f -name '*.go' $(foreach EXCLUDE_DIR,$(EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") +EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated +EXCLUDE_FILES := *generated.deepcopy.go +SOURCES_QUERY := find ./ -type f -name '*.go' $(foreach EXCLUDE_DIR,$(EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)") SOURCES := $(shell $(SOURCES_QUERY)) DASHBOARDSOURCES := $(shell find $(DASHBOARDDIR)/src -name '*.js') $(DASHBOARDDIR)/package.json LINT_EXCLUDES:= @@ -166,7 +167,6 @@ else LINT_EXCLUDES+=.*\.enterprise\.go$$ endif - .DEFAULT_GOAL := all .PHONY: all all: check-vars verify-generated build @@ -191,6 +191,7 @@ license-verify: fmt: @echo ">> Ensuring style of files" @$(GOPATH)/bin/goimports -w $(SOURCES) + @$(GOPATH)/bin/gci write -s "standard" -s "default" -s "prefix(github.com/arangodb)" -s "prefix(github.com/arangodb/kube-arangodb)" $(SOURCES) .PHONY: license license: @@ -454,13 +455,15 @@ init: tools update-generated $(BIN) vendor .PHONY: tools tools: update-vendor @echo ">> Fetching golangci-lint linter" - @GOBIN=$(GOPATH)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.1 + @GOBIN=$(GOPATH)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2 @echo ">> Fetching goimports" @GOBIN=$(GOPATH)/bin go install golang.org/x/tools/cmd/goimports@0bb7e5c47b1a31f85d4f173edc878a8e049764a5 @echo ">> Fetching license check" @GOBIN=$(GOPATH)/bin go install github.com/google/addlicense@6d92264d717064f28b32464f0f9693a5b4ef0239 @echo ">> Fetching GO Assets Builder" @GOBIN=$(GOPATH)/bin go install github.com/jessevdk/go-assets-builder@b8483521738fd2198ecfc378067a4e8a6079f8e5 + @echo ">> Fetching gci" + @GOBIN=$(GOPATH)/bin go install github.com/daixiang0/gci@v0.3.0 .PHONY: vendor vendor: diff --git a/cmd/admin.go b/cmd/admin.go index 6c5b15cf9..882409ba9 100644 --- a/cmd/admin.go +++ b/cmd/admin.go @@ -33,8 +33,6 @@ import ( "strconv" "syscall" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/spf13/cobra" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,10 +40,12 @@ import ( "github.com/arangodb-helper/go-certificates" "github.com/arangodb/go-driver/jwt" "github.com/arangodb/go-driver/v2/connection" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" "github.com/arangodb/kube-arangodb/pkg/util/kclient" diff --git a/cmd/cmd.go b/cmd/cmd.go index 5c4ebef4b..986bff05a 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -31,31 +31,7 @@ import ( "strings" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/gin-gonic/gin" - - operatorHTTP "github.com/arangodb/kube-arangodb/pkg/util/http" - - "github.com/arangodb/kube-arangodb/pkg/version" - - "github.com/arangodb/kube-arangodb/pkg/operator/scope" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/crd" - "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" - "github.com/arangodb/kube-arangodb/pkg/logging" - "github.com/arangodb/kube-arangodb/pkg/operator" - "github.com/arangodb/kube-arangodb/pkg/server" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - utilsError "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/arangodb/kube-arangodb/pkg/util/probe" - "github.com/arangodb/kube-arangodb/pkg/util/retry" "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/spf13/cobra" @@ -65,9 +41,28 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes" - v1core "k8s.io/client-go/kubernetes/typed/core/v1" + typedCore "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/record" "k8s.io/klog" + + deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/crd" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme" + "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/operator" + "github.com/arangodb/kube-arangodb/pkg/operator/scope" + "github.com/arangodb/kube-arangodb/pkg/server" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + utilsError "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + operatorHTTP "github.com/arangodb/kube-arangodb/pkg/util/http" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" + "github.com/arangodb/kube-arangodb/pkg/util/probe" + "github.com/arangodb/kube-arangodb/pkg/util/retry" + "github.com/arangodb/kube-arangodb/pkg/version" ) const ( @@ -477,7 +472,7 @@ func createRecorder(kubecli kubernetes.Interface, name, namespace string) record eventBroadcaster.StartLogging(func(format string, args ...interface{}) { eventRecorder.Info(format, args...) }) - eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(kubecli.CoreV1().RESTClient()).Events(namespace)}) + eventBroadcaster.StartRecordingToSink(&typedCore.EventSinkImpl{Interface: typedCore.New(kubecli.CoreV1().RESTClient()).Events(namespace)}) combinedScheme := runtime.NewScheme() scheme.AddToScheme(combinedScheme) core.AddToScheme(combinedScheme) diff --git a/cmd/exporter.go b/cmd/exporter.go index 44ccfde88..83887e3b0 100644 --- a/cmd/exporter.go +++ b/cmd/exporter.go @@ -28,11 +28,11 @@ import ( "syscall" "time" - "github.com/arangodb/kube-arangodb/pkg/exporter" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/rs/zerolog/log" "github.com/spf13/cobra" + + "github.com/arangodb/kube-arangodb/pkg/exporter" + "github.com/arangodb/kube-arangodb/pkg/util" ) var ( diff --git a/cmd/lifecycle.go b/cmd/lifecycle.go index 5f696103a..d09e6ad7e 100644 --- a/cmd/lifecycle.go +++ b/cmd/lifecycle.go @@ -29,19 +29,16 @@ import ( "strconv" "time" - "github.com/arangodb/kube-arangodb/pkg/handlers/utils" - - "github.com/arangodb/kube-arangodb/pkg/util/retry" - - "github.com/arangodb/kube-arangodb/pkg/version" - "github.com/spf13/cobra" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/handlers/utils" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/kclient" + "github.com/arangodb/kube-arangodb/pkg/util/retry" + "github.com/arangodb/kube-arangodb/pkg/version" ) var ( diff --git a/cmd/lifecycle_probes.go b/cmd/lifecycle_probes.go index 0b503da37..cb3358da8 100644 --- a/cmd/lifecycle_probes.go +++ b/cmd/lifecycle_probes.go @@ -28,13 +28,15 @@ import ( "os" "path" - "github.com/arangodb/go-driver/jwt" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/pkg/errors" "github.com/rs/zerolog/log" "github.com/spf13/cobra" + + "github.com/arangodb/go-driver/jwt" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/constants" ) var ( diff --git a/cmd/lifecycle_wait.go b/cmd/lifecycle_wait.go index 2f92f8c6c..ca8c85a0e 100644 --- a/cmd/lifecycle_wait.go +++ b/cmd/lifecycle_wait.go @@ -26,11 +26,11 @@ import ( "os" "time" + "github.com/spf13/cobra" + v1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" - - "github.com/spf13/cobra" ) const ( diff --git a/cmd/reboot.go b/cmd/reboot.go index 8315879c3..5f0b5320e 100644 --- a/cmd/reboot.go +++ b/cmd/reboot.go @@ -31,7 +31,14 @@ import ( "strings" "sync" + "github.com/pkg/errors" + "github.com/spf13/cobra" + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/client-go/kubernetes" deplv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" acli "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" @@ -39,13 +46,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/pkg/errors" - "github.com/spf13/cobra" - core "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/client-go/kubernetes" ) var ( diff --git a/cmd/storage.go b/cmd/storage.go index 9a374af9c..cf65783ed 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -26,13 +26,12 @@ import ( "os" "strconv" - "github.com/arangodb/kube-arangodb/pkg/version" - "github.com/spf13/cobra" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner/service" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/version" ) var ( diff --git a/cmd/version.go b/cmd/version.go index c65f80d32..fb4c9d920 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -23,8 +23,9 @@ package cmd import ( "fmt" - "github.com/arangodb/kube-arangodb/pkg/version" "github.com/spf13/cobra" + + "github.com/arangodb/kube-arangodb/pkg/version" ) func init() { diff --git a/pkg/apis/apps/v1/job.go b/pkg/apis/apps/v1/job.go index 6f0f90238..96ba4eeba 100644 --- a/pkg/apis/apps/v1/job.go +++ b/pkg/apis/apps/v1/job.go @@ -21,10 +21,10 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/apps" - batchv1 "k8s.io/api/batch/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/apps" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/apps/v1/register.go b/pkg/apis/apps/v1/register.go index 97ae42a71..e621af2e0 100644 --- a/pkg/apis/apps/v1/register.go +++ b/pkg/apis/apps/v1/register.go @@ -21,11 +21,11 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/apps" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/apps" ) const ( diff --git a/pkg/apis/backup/v1/backup.go b/pkg/apis/backup/v1/backup.go index f586a31ba..057b1441f 100644 --- a/pkg/apis/backup/v1/backup.go +++ b/pkg/apis/backup/v1/backup.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/backup" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/backup" ) const ( diff --git a/pkg/apis/backup/v1/backup_policy.go b/pkg/apis/backup/v1/backup_policy.go index 761d26bc8..705cfbf83 100644 --- a/pkg/apis/backup/v1/backup_policy.go +++ b/pkg/apis/backup/v1/backup_policy.go @@ -23,10 +23,10 @@ package v1 import ( "fmt" - deployment "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - - "github.com/arangodb/kube-arangodb/pkg/handlers/utils" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + deployment "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/handlers/utils" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/backup/v1/backup_policy_validate.go b/pkg/apis/backup/v1/backup_policy_validate.go index 5dcce071c..c933acfeb 100644 --- a/pkg/apis/backup/v1/backup_policy_validate.go +++ b/pkg/apis/backup/v1/backup_policy_validate.go @@ -23,8 +23,9 @@ package v1 import ( "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/robfig/cron" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func (a *ArangoBackupPolicy) Validate() error { diff --git a/pkg/apis/backup/v1/backup_state.go b/pkg/apis/backup/v1/backup_state.go index 6607cf066..d990ab4e7 100644 --- a/pkg/apis/backup/v1/backup_state.go +++ b/pkg/apis/backup/v1/backup_state.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/handlers/backup/state" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/handlers/backup/state" ) const ( diff --git a/pkg/apis/backup/v1/backup_status.go b/pkg/apis/backup/v1/backup_status.go index e742e3c52..3fbd4da07 100644 --- a/pkg/apis/backup/v1/backup_status.go +++ b/pkg/apis/backup/v1/backup_status.go @@ -21,8 +21,9 @@ package v1 import ( - shared "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" ) // ArangoBackupStatus contains the status part of diff --git a/pkg/apis/backup/v1/register.go b/pkg/apis/backup/v1/register.go index b34c76a7b..af0a0268d 100644 --- a/pkg/apis/backup/v1/register.go +++ b/pkg/apis/backup/v1/register.go @@ -21,10 +21,11 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/backup" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/backup" ) const ( diff --git a/pkg/apis/deployment/v1/arango_member.go b/pkg/apis/deployment/v1/arango_member.go index 0373150c1..4ae204928 100644 --- a/pkg/apis/deployment/v1/arango_member.go +++ b/pkg/apis/deployment/v1/arango_member.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/deployment/v1/architecture.go b/pkg/apis/deployment/v1/architecture.go index c3a32127f..b8d5d8f4c 100644 --- a/pkg/apis/deployment/v1/architecture.go +++ b/pkg/apis/deployment/v1/architecture.go @@ -23,9 +23,10 @@ package v1 import ( "runtime" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/pkg/errors" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) type ArangoDeploymentArchitecture []ArangoDeploymentArchitectureType diff --git a/pkg/apis/deployment/v1/authentication_spec_test.go b/pkg/apis/deployment/v1/authentication_spec_test.go index 8c1ef64ff..41e5700ad 100644 --- a/pkg/apis/deployment/v1/authentication_spec_test.go +++ b/pkg/apis/deployment/v1/authentication_spec_test.go @@ -23,8 +23,9 @@ package v1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestAuthenticationSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v1/bootstrap.go b/pkg/apis/deployment/v1/bootstrap.go index 9b8ecbab0..bb6060e3e 100644 --- a/pkg/apis/deployment/v1/bootstrap.go +++ b/pkg/apis/deployment/v1/bootstrap.go @@ -21,9 +21,8 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/apis/deployment/v1/chaos_spec.go b/pkg/apis/deployment/v1/chaos_spec.go index 96fbd22fe..d2c5de544 100644 --- a/pkg/apis/deployment/v1/chaos_spec.go +++ b/pkg/apis/deployment/v1/chaos_spec.go @@ -23,9 +23,8 @@ package v1 import ( time "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ChaosSpec holds configuration for the deployment chaos monkey. diff --git a/pkg/apis/deployment/v1/cluster_synchronization.go b/pkg/apis/deployment/v1/cluster_synchronization.go index 2a15de293..7767c0b62 100644 --- a/pkg/apis/deployment/v1/cluster_synchronization.go +++ b/pkg/apis/deployment/v1/cluster_synchronization.go @@ -21,9 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/deployment/v1/cluster_synchronization_spec.go b/pkg/apis/deployment/v1/cluster_synchronization_spec.go index 206e23668..2a17a9595 100644 --- a/pkg/apis/deployment/v1/cluster_synchronization_spec.go +++ b/pkg/apis/deployment/v1/cluster_synchronization_spec.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/pkg/errors" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) type ArangoClusterSynchronizationSpec struct { diff --git a/pkg/apis/deployment/v1/conditions.go b/pkg/apis/deployment/v1/conditions.go index 4c790ef5d..07f540a35 100644 --- a/pkg/apis/deployment/v1/conditions.go +++ b/pkg/apis/deployment/v1/conditions.go @@ -21,9 +21,10 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util" ) // ConditionType is a strongly typed condition name diff --git a/pkg/apis/deployment/v1/deployment.go b/pkg/apis/deployment/v1/deployment.go index 152917c40..ec18921a0 100644 --- a/pkg/apis/deployment/v1/deployment.go +++ b/pkg/apis/deployment/v1/deployment.go @@ -21,9 +21,10 @@ package v1 import ( + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" "github.com/arangodb/kube-arangodb/pkg/util/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/deployment/v1/deployment_metrics_spec.go b/pkg/apis/deployment/v1/deployment_metrics_spec.go index 3cc37f2dc..2e946247a 100644 --- a/pkg/apis/deployment/v1/deployment_metrics_spec.go +++ b/pkg/apis/deployment/v1/deployment_metrics_spec.go @@ -22,9 +22,10 @@ package v1 import ( + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" - core "k8s.io/api/core/v1" ) // MetricsAuthenticationSpec contains spec for authentication with arangodb diff --git a/pkg/apis/deployment/v1/external_access_spec.go b/pkg/apis/deployment/v1/external_access_spec.go index f2d5dc366..e8dc59d9f 100644 --- a/pkg/apis/deployment/v1/external_access_spec.go +++ b/pkg/apis/deployment/v1/external_access_spec.go @@ -24,9 +24,8 @@ import ( "net" "net/url" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ExternalAccessSpec holds configuration for the external access provided for the deployment. diff --git a/pkg/apis/deployment/v1/external_access_type.go b/pkg/apis/deployment/v1/external_access_type.go index 798059d7b..f44532b70 100644 --- a/pkg/apis/deployment/v1/external_access_type.go +++ b/pkg/apis/deployment/v1/external_access_type.go @@ -21,9 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ExternalAccessType specifies the type of external access provides for the deployment diff --git a/pkg/apis/deployment/v1/license_spec_test.go b/pkg/apis/deployment/v1/license_spec_test.go index b8a2d5d30..cd32402b5 100644 --- a/pkg/apis/deployment/v1/license_spec_test.go +++ b/pkg/apis/deployment/v1/license_spec_test.go @@ -23,8 +23,9 @@ package v1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestLicenseSpecValidation(t *testing.T) { diff --git a/pkg/apis/deployment/v1/member_status.go b/pkg/apis/deployment/v1/member_status.go index cd6646c05..01a5cc782 100644 --- a/pkg/apis/deployment/v1/member_status.go +++ b/pkg/apis/deployment/v1/member_status.go @@ -23,13 +23,14 @@ package v1 import ( "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" driver "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) // MemberStatus holds the current status of a single member (server) diff --git a/pkg/apis/deployment/v1/member_status_list.go b/pkg/apis/deployment/v1/member_status_list.go index 27f5919b2..90684a436 100644 --- a/pkg/apis/deployment/v1/member_status_list.go +++ b/pkg/apis/deployment/v1/member_status_list.go @@ -25,9 +25,9 @@ import ( "sort" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // MemberStatusList is a list of MemberStatus entries diff --git a/pkg/apis/deployment/v1/register.go b/pkg/apis/deployment/v1/register.go index 8762315e3..3743449ca 100644 --- a/pkg/apis/deployment/v1/register.go +++ b/pkg/apis/deployment/v1/register.go @@ -21,10 +21,11 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" ) const ( diff --git a/pkg/apis/deployment/v1/rocksdb_spec_test.go b/pkg/apis/deployment/v1/rocksdb_spec_test.go index 4ac9543b6..f4170af9a 100644 --- a/pkg/apis/deployment/v1/rocksdb_spec_test.go +++ b/pkg/apis/deployment/v1/rocksdb_spec_test.go @@ -23,8 +23,9 @@ package v1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestRocksDBSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v1/secret_hashes_test.go b/pkg/apis/deployment/v1/secret_hashes_test.go index 5d8cc31ff..c7cc296c1 100644 --- a/pkg/apis/deployment/v1/secret_hashes_test.go +++ b/pkg/apis/deployment/v1/secret_hashes_test.go @@ -21,9 +21,9 @@ package v1 import ( - "github.com/magiconair/properties/assert" - "testing" + + "github.com/magiconair/properties/assert" ) func TestSecretHashes_Equal(t *testing.T) { diff --git a/pkg/apis/deployment/v1/server_group_init_containers.go b/pkg/apis/deployment/v1/server_group_init_containers.go index f369e5309..47676f1ef 100644 --- a/pkg/apis/deployment/v1/server_group_init_containers.go +++ b/pkg/apis/deployment/v1/server_group_init_containers.go @@ -21,11 +21,11 @@ package v1 import ( + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" - - core "k8s.io/api/core/v1" ) const ( diff --git a/pkg/apis/deployment/v1/server_group_spec.go b/pkg/apis/deployment/v1/server_group_spec.go index c6465dd70..62e88a45a 100644 --- a/pkg/apis/deployment/v1/server_group_spec.go +++ b/pkg/apis/deployment/v1/server_group_spec.go @@ -25,16 +25,14 @@ import ( "strings" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" arangodOptions "github.com/arangodb/kube-arangodb/pkg/util/arangod/options" arangosyncOptions "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ServerGroupShutdownMethod enum of possible shutdown methods diff --git a/pkg/apis/deployment/v1/server_group_spec_test.go b/pkg/apis/deployment/v1/server_group_spec_test.go index 81a44f5c7..0c3aade3b 100644 --- a/pkg/apis/deployment/v1/server_group_spec_test.go +++ b/pkg/apis/deployment/v1/server_group_spec_test.go @@ -23,8 +23,9 @@ package v1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestServerGroupSpecValidateCount(t *testing.T) { diff --git a/pkg/apis/deployment/v1/server_group_volume.go b/pkg/apis/deployment/v1/server_group_volume.go index 8f7f143ef..3d0460040 100644 --- a/pkg/apis/deployment/v1/server_group_volume.go +++ b/pkg/apis/deployment/v1/server_group_volume.go @@ -23,13 +23,12 @@ package v1 import ( "fmt" - "github.com/arangodb/kube-arangodb/pkg/util/errors" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) var ( diff --git a/pkg/apis/deployment/v1/server_group_volume_mount.go b/pkg/apis/deployment/v1/server_group_volume_mount.go index f023a6069..c4dd934e5 100644 --- a/pkg/apis/deployment/v1/server_group_volume_mount.go +++ b/pkg/apis/deployment/v1/server_group_volume_mount.go @@ -23,10 +23,10 @@ package v1 import ( "fmt" + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" - - core "k8s.io/api/core/v1" ) type ServerGroupSpecVolumeMounts []ServerGroupSpecVolumeMount diff --git a/pkg/apis/deployment/v1/server_group_volume_test.go b/pkg/apis/deployment/v1/server_group_volume_test.go index d64472c92..be0f93367 100644 --- a/pkg/apis/deployment/v1/server_group_volume_test.go +++ b/pkg/apis/deployment/v1/server_group_volume_test.go @@ -24,10 +24,10 @@ import ( "fmt" "testing" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) const ( diff --git a/pkg/apis/deployment/v1/sync_monitoring_spec_test.go b/pkg/apis/deployment/v1/sync_monitoring_spec_test.go index 8f8b47e4a..05754db23 100644 --- a/pkg/apis/deployment/v1/sync_monitoring_spec_test.go +++ b/pkg/apis/deployment/v1/sync_monitoring_spec_test.go @@ -23,8 +23,9 @@ package v1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestMonitoringSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v1/sync_spec.go b/pkg/apis/deployment/v1/sync_spec.go index 6930cc600..5fc502432 100644 --- a/pkg/apis/deployment/v1/sync_spec.go +++ b/pkg/apis/deployment/v1/sync_spec.go @@ -21,9 +21,8 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // SyncSpec holds dc2dc replication specific configuration settings diff --git a/pkg/apis/deployment/v1/sync_spec_test.go b/pkg/apis/deployment/v1/sync_spec_test.go index 2be90e5fb..bf82c737b 100644 --- a/pkg/apis/deployment/v1/sync_spec_test.go +++ b/pkg/apis/deployment/v1/sync_spec_test.go @@ -23,8 +23,9 @@ package v1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestSyncSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v1/tls_spec.go b/pkg/apis/deployment/v1/tls_spec.go index b83f0f57d..d25f0fcd4 100644 --- a/pkg/apis/deployment/v1/tls_spec.go +++ b/pkg/apis/deployment/v1/tls_spec.go @@ -23,10 +23,9 @@ package v1 import ( "net" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/validation" ) diff --git a/pkg/apis/deployment/v1/tls_spec_test.go b/pkg/apis/deployment/v1/tls_spec_test.go index 79053a6a5..e4df3e854 100644 --- a/pkg/apis/deployment/v1/tls_spec_test.go +++ b/pkg/apis/deployment/v1/tls_spec_test.go @@ -24,8 +24,9 @@ import ( "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestTLSSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/arango_member.go b/pkg/apis/deployment/v2alpha1/arango_member.go index bdfe78e28..a845d575c 100644 --- a/pkg/apis/deployment/v2alpha1/arango_member.go +++ b/pkg/apis/deployment/v2alpha1/arango_member.go @@ -21,8 +21,9 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/deployment/v2alpha1/architecture.go b/pkg/apis/deployment/v2alpha1/architecture.go index f5d9ee4e2..1cf1a6502 100644 --- a/pkg/apis/deployment/v2alpha1/architecture.go +++ b/pkg/apis/deployment/v2alpha1/architecture.go @@ -23,9 +23,10 @@ package v2alpha1 import ( "runtime" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/pkg/errors" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) type ArangoDeploymentArchitecture []ArangoDeploymentArchitectureType diff --git a/pkg/apis/deployment/v2alpha1/authentication_spec_test.go b/pkg/apis/deployment/v2alpha1/authentication_spec_test.go index 1ac3d24df..56e1ef277 100644 --- a/pkg/apis/deployment/v2alpha1/authentication_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/authentication_spec_test.go @@ -23,8 +23,9 @@ package v2alpha1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestAuthenticationSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/bootstrap.go b/pkg/apis/deployment/v2alpha1/bootstrap.go index 126f86461..6d1b925b2 100644 --- a/pkg/apis/deployment/v2alpha1/bootstrap.go +++ b/pkg/apis/deployment/v2alpha1/bootstrap.go @@ -21,9 +21,8 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/apis/deployment/v2alpha1/chaos_spec.go b/pkg/apis/deployment/v2alpha1/chaos_spec.go index c0f172ab0..6c93c6ab2 100644 --- a/pkg/apis/deployment/v2alpha1/chaos_spec.go +++ b/pkg/apis/deployment/v2alpha1/chaos_spec.go @@ -23,9 +23,8 @@ package v2alpha1 import ( time "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ChaosSpec holds configuration for the deployment chaos monkey. diff --git a/pkg/apis/deployment/v2alpha1/cluster_synchronization.go b/pkg/apis/deployment/v2alpha1/cluster_synchronization.go index 6a1b88f70..5c6cf752e 100644 --- a/pkg/apis/deployment/v2alpha1/cluster_synchronization.go +++ b/pkg/apis/deployment/v2alpha1/cluster_synchronization.go @@ -21,9 +21,9 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/deployment/v2alpha1/cluster_synchronization_spec.go b/pkg/apis/deployment/v2alpha1/cluster_synchronization_spec.go index 0058ffb90..a4ccd487d 100644 --- a/pkg/apis/deployment/v2alpha1/cluster_synchronization_spec.go +++ b/pkg/apis/deployment/v2alpha1/cluster_synchronization_spec.go @@ -21,8 +21,9 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/pkg/errors" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) type ArangoClusterSynchronizationSpec struct { diff --git a/pkg/apis/deployment/v2alpha1/conditions.go b/pkg/apis/deployment/v2alpha1/conditions.go index 311df6b21..aef1e47e9 100644 --- a/pkg/apis/deployment/v2alpha1/conditions.go +++ b/pkg/apis/deployment/v2alpha1/conditions.go @@ -21,9 +21,10 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/util" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util" ) // ConditionType is a strongly typed condition name diff --git a/pkg/apis/deployment/v2alpha1/deployment.go b/pkg/apis/deployment/v2alpha1/deployment.go index e6ed60161..674ffe224 100644 --- a/pkg/apis/deployment/v2alpha1/deployment.go +++ b/pkg/apis/deployment/v2alpha1/deployment.go @@ -21,9 +21,10 @@ package v2alpha1 import ( + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" "github.com/arangodb/kube-arangodb/pkg/util/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/deployment/v2alpha1/deployment_metrics_spec.go b/pkg/apis/deployment/v2alpha1/deployment_metrics_spec.go index faf09b5a1..43457da63 100644 --- a/pkg/apis/deployment/v2alpha1/deployment_metrics_spec.go +++ b/pkg/apis/deployment/v2alpha1/deployment_metrics_spec.go @@ -22,9 +22,10 @@ package v2alpha1 import ( + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" - core "k8s.io/api/core/v1" ) // MetricsAuthenticationSpec contains spec for authentication with arangodb diff --git a/pkg/apis/deployment/v2alpha1/external_access_spec.go b/pkg/apis/deployment/v2alpha1/external_access_spec.go index 71bb705d3..9aa36dee3 100644 --- a/pkg/apis/deployment/v2alpha1/external_access_spec.go +++ b/pkg/apis/deployment/v2alpha1/external_access_spec.go @@ -24,9 +24,8 @@ import ( "net" "net/url" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ExternalAccessSpec holds configuration for the external access provided for the deployment. diff --git a/pkg/apis/deployment/v2alpha1/external_access_type.go b/pkg/apis/deployment/v2alpha1/external_access_type.go index 110c3e2b1..7b52f5346 100644 --- a/pkg/apis/deployment/v2alpha1/external_access_type.go +++ b/pkg/apis/deployment/v2alpha1/external_access_type.go @@ -21,9 +21,9 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ExternalAccessType specifies the type of external access provides for the deployment diff --git a/pkg/apis/deployment/v2alpha1/license_spec_test.go b/pkg/apis/deployment/v2alpha1/license_spec_test.go index 30d0ac1cb..c3807cbd4 100644 --- a/pkg/apis/deployment/v2alpha1/license_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/license_spec_test.go @@ -23,8 +23,9 @@ package v2alpha1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestLicenseSpecValidation(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/member_status.go b/pkg/apis/deployment/v2alpha1/member_status.go index a1598a39d..c6b715c72 100644 --- a/pkg/apis/deployment/v2alpha1/member_status.go +++ b/pkg/apis/deployment/v2alpha1/member_status.go @@ -23,13 +23,14 @@ package v2alpha1 import ( "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" driver "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) // MemberStatus holds the current status of a single member (server) diff --git a/pkg/apis/deployment/v2alpha1/member_status_list.go b/pkg/apis/deployment/v2alpha1/member_status_list.go index 65329d9d4..6ae85836c 100644 --- a/pkg/apis/deployment/v2alpha1/member_status_list.go +++ b/pkg/apis/deployment/v2alpha1/member_status_list.go @@ -25,9 +25,9 @@ import ( "sort" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // MemberStatusList is a list of MemberStatus entries diff --git a/pkg/apis/deployment/v2alpha1/register.go b/pkg/apis/deployment/v2alpha1/register.go index 59325cf1d..cce0b7066 100644 --- a/pkg/apis/deployment/v2alpha1/register.go +++ b/pkg/apis/deployment/v2alpha1/register.go @@ -21,10 +21,11 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" ) const ( diff --git a/pkg/apis/deployment/v2alpha1/rocksdb_spec_test.go b/pkg/apis/deployment/v2alpha1/rocksdb_spec_test.go index fb858bc62..e8be1a3bf 100644 --- a/pkg/apis/deployment/v2alpha1/rocksdb_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/rocksdb_spec_test.go @@ -23,8 +23,9 @@ package v2alpha1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestRocksDBSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/secret_hashes_test.go b/pkg/apis/deployment/v2alpha1/secret_hashes_test.go index a7742a88c..6f82bd8a1 100644 --- a/pkg/apis/deployment/v2alpha1/secret_hashes_test.go +++ b/pkg/apis/deployment/v2alpha1/secret_hashes_test.go @@ -21,9 +21,9 @@ package v2alpha1 import ( - "github.com/magiconair/properties/assert" - "testing" + + "github.com/magiconair/properties/assert" ) func TestSecretHashes_Equal(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/server_group_init_containers.go b/pkg/apis/deployment/v2alpha1/server_group_init_containers.go index dba552936..ba5a88fde 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_init_containers.go +++ b/pkg/apis/deployment/v2alpha1/server_group_init_containers.go @@ -21,11 +21,11 @@ package v2alpha1 import ( + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" - - core "k8s.io/api/core/v1" ) const ( diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec.go b/pkg/apis/deployment/v2alpha1/server_group_spec.go index dc9c7fde8..7cd7e0603 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_spec.go +++ b/pkg/apis/deployment/v2alpha1/server_group_spec.go @@ -25,16 +25,14 @@ import ( "strings" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" arangodOptions "github.com/arangodb/kube-arangodb/pkg/util/arangod/options" arangosyncOptions "github.com/arangodb/kube-arangodb/pkg/util/arangosync/options" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // ServerGroupShutdownMethod enum of possible shutdown methods diff --git a/pkg/apis/deployment/v2alpha1/server_group_spec_test.go b/pkg/apis/deployment/v2alpha1/server_group_spec_test.go index e6ff69183..6369770f0 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/server_group_spec_test.go @@ -23,8 +23,9 @@ package v2alpha1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestServerGroupSpecValidateCount(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/server_group_volume.go b/pkg/apis/deployment/v2alpha1/server_group_volume.go index af27f1a36..9a36fa9f0 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_volume.go +++ b/pkg/apis/deployment/v2alpha1/server_group_volume.go @@ -23,13 +23,12 @@ package v2alpha1 import ( "fmt" - "github.com/arangodb/kube-arangodb/pkg/util/errors" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) var ( diff --git a/pkg/apis/deployment/v2alpha1/server_group_volume_mount.go b/pkg/apis/deployment/v2alpha1/server_group_volume_mount.go index c981a8959..bb303044e 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_volume_mount.go +++ b/pkg/apis/deployment/v2alpha1/server_group_volume_mount.go @@ -23,10 +23,10 @@ package v2alpha1 import ( "fmt" + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" sharedv1 "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" - - core "k8s.io/api/core/v1" ) type ServerGroupSpecVolumeMounts []ServerGroupSpecVolumeMount diff --git a/pkg/apis/deployment/v2alpha1/server_group_volume_test.go b/pkg/apis/deployment/v2alpha1/server_group_volume_test.go index f08a75f1b..c6083f9eb 100644 --- a/pkg/apis/deployment/v2alpha1/server_group_volume_test.go +++ b/pkg/apis/deployment/v2alpha1/server_group_volume_test.go @@ -24,10 +24,10 @@ import ( "fmt" "testing" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) const ( diff --git a/pkg/apis/deployment/v2alpha1/sync_monitoring_spec_test.go b/pkg/apis/deployment/v2alpha1/sync_monitoring_spec_test.go index d2fca266d..41ed94ac3 100644 --- a/pkg/apis/deployment/v2alpha1/sync_monitoring_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/sync_monitoring_spec_test.go @@ -23,8 +23,9 @@ package v2alpha1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestMonitoringSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/sync_spec.go b/pkg/apis/deployment/v2alpha1/sync_spec.go index 5f6eadce8..26552b76b 100644 --- a/pkg/apis/deployment/v2alpha1/sync_spec.go +++ b/pkg/apis/deployment/v2alpha1/sync_spec.go @@ -21,9 +21,8 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // SyncSpec holds dc2dc replication specific configuration settings diff --git a/pkg/apis/deployment/v2alpha1/sync_spec_test.go b/pkg/apis/deployment/v2alpha1/sync_spec_test.go index ac10f8d54..4534bc58d 100644 --- a/pkg/apis/deployment/v2alpha1/sync_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/sync_spec_test.go @@ -23,8 +23,9 @@ package v2alpha1 import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestSyncSpecValidate(t *testing.T) { diff --git a/pkg/apis/deployment/v2alpha1/tls_spec.go b/pkg/apis/deployment/v2alpha1/tls_spec.go index d881c04be..3aa687459 100644 --- a/pkg/apis/deployment/v2alpha1/tls_spec.go +++ b/pkg/apis/deployment/v2alpha1/tls_spec.go @@ -23,10 +23,9 @@ package v2alpha1 import ( "net" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/validation" ) diff --git a/pkg/apis/deployment/v2alpha1/tls_spec_test.go b/pkg/apis/deployment/v2alpha1/tls_spec_test.go index c599c5543..ed8528874 100644 --- a/pkg/apis/deployment/v2alpha1/tls_spec_test.go +++ b/pkg/apis/deployment/v2alpha1/tls_spec_test.go @@ -24,8 +24,9 @@ import ( "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/stretchr/testify/assert" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func TestTLSSpecValidate(t *testing.T) { diff --git a/pkg/apis/replication/v1/endpoint_spec.go b/pkg/apis/replication/v1/endpoint_spec.go index aeb9a851a..ab10f45db 100644 --- a/pkg/apis/replication/v1/endpoint_spec.go +++ b/pkg/apis/replication/v1/endpoint_spec.go @@ -23,10 +23,9 @@ package v1 import ( "net/url" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // EndpointSpec contains the specification used to reach the syncmasters diff --git a/pkg/apis/replication/v1/register.go b/pkg/apis/replication/v1/register.go index 75f953d37..c94b274ca 100644 --- a/pkg/apis/replication/v1/register.go +++ b/pkg/apis/replication/v1/register.go @@ -21,10 +21,11 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/replication" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/replication" ) const ( diff --git a/pkg/apis/replication/v1/replication.go b/pkg/apis/replication/v1/replication.go index 7dd23879f..39071b279 100644 --- a/pkg/apis/replication/v1/replication.go +++ b/pkg/apis/replication/v1/replication.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/replication" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/replication" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/replication/v2alpha1/endpoint_spec.go b/pkg/apis/replication/v2alpha1/endpoint_spec.go index 4473b6376..95c049054 100644 --- a/pkg/apis/replication/v2alpha1/endpoint_spec.go +++ b/pkg/apis/replication/v2alpha1/endpoint_spec.go @@ -23,10 +23,9 @@ package v2alpha1 import ( "net/url" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // EndpointSpec contains the specification used to reach the syncmasters diff --git a/pkg/apis/replication/v2alpha1/register.go b/pkg/apis/replication/v2alpha1/register.go index a751c46bc..486b9f840 100644 --- a/pkg/apis/replication/v2alpha1/register.go +++ b/pkg/apis/replication/v2alpha1/register.go @@ -21,10 +21,11 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/replication" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/apis/replication" ) const ( diff --git a/pkg/apis/replication/v2alpha1/replication.go b/pkg/apis/replication/v2alpha1/replication.go index 530df8da5..60edc912a 100644 --- a/pkg/apis/replication/v2alpha1/replication.go +++ b/pkg/apis/replication/v2alpha1/replication.go @@ -21,8 +21,9 @@ package v2alpha1 import ( - "github.com/arangodb/kube-arangodb/pkg/apis/replication" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/replication" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/shared/v1/resource.go b/pkg/apis/shared/v1/resource.go index 6c8eb4be6..9ca8122c5 100644 --- a/pkg/apis/shared/v1/resource.go +++ b/pkg/apis/shared/v1/resource.go @@ -23,9 +23,9 @@ package v1 import ( "strings" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "k8s.io/apimachinery/pkg/util/validation" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // KubernetesResourceName define name of kubernetes resource including validation function diff --git a/pkg/crd/apply.go b/pkg/crd/apply.go index 0b6e00162..e61fb5586 100644 --- a/pkg/crd/apply.go +++ b/pkg/crd/apply.go @@ -24,13 +24,15 @@ import ( "context" "fmt" - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/logging" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" authorization "k8s.io/api/authorization/v1" apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/go-driver" + + "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" ) var logger = logging.Global().RegisterAndGetLogger("crd", logging.Info) diff --git a/pkg/crd/apply_test.go b/pkg/crd/apply_test.go index 02ed746ce..bed95f435 100644 --- a/pkg/crd/apply_test.go +++ b/pkg/crd/apply_test.go @@ -24,8 +24,9 @@ import ( "context" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util/kclient" ) func Test_Apply(t *testing.T) { diff --git a/pkg/crd/arangoclustersynchronizations.go b/pkg/crd/arangoclustersynchronizations.go index ea85ddd05..7a0f90d25 100644 --- a/pkg/crd/arangoclustersynchronizations.go +++ b/pkg/crd/arangoclustersynchronizations.go @@ -21,8 +21,9 @@ package crd import ( - "github.com/arangodb/kube-arangodb/pkg/util" apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func init() { diff --git a/pkg/crd/arangotasks.go b/pkg/crd/arangotasks.go index 390b0e08e..88d88a4e8 100644 --- a/pkg/crd/arangotasks.go +++ b/pkg/crd/arangotasks.go @@ -21,8 +21,9 @@ package crd import ( - "github.com/arangodb/kube-arangodb/pkg/util" apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func init() { diff --git a/pkg/crd/definitions.go b/pkg/crd/definitions.go index 62edf50d7..683e15c90 100644 --- a/pkg/crd/definitions.go +++ b/pkg/crd/definitions.go @@ -23,9 +23,11 @@ package crd import ( "sync" - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/util/errors" apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + + "github.com/arangodb/go-driver" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const Version = "arangodb.com/version" diff --git a/pkg/crd/version_test.go b/pkg/crd/version_test.go index 1324f7d76..76d5dc343 100644 --- a/pkg/crd/version_test.go +++ b/pkg/crd/version_test.go @@ -23,8 +23,9 @@ package crd import ( "testing" - "github.com/arangodb/go-driver" "github.com/stretchr/testify/require" + + "github.com/arangodb/go-driver" ) func Test_Versions(t *testing.T) { diff --git a/pkg/deployment/access_package.go b/pkg/deployment/access_package.go index cc299e6e3..5afcf53d0 100644 --- a/pkg/deployment/access_package.go +++ b/pkg/deployment/access_package.go @@ -25,18 +25,16 @@ import ( "strings" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - certificates "github.com/arangodb-helper/go-certificates" - + "gopkg.in/yaml.v3" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + certificates "github.com/arangodb-helper/go-certificates" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "gopkg.in/yaml.v3" ) const ( diff --git a/pkg/deployment/acs/acs.community.go b/pkg/deployment/acs/acs.community.go index 8901fd36e..e4c746346 100644 --- a/pkg/deployment/acs/acs.community.go +++ b/pkg/deployment/acs/acs.community.go @@ -24,11 +24,12 @@ package acs import ( "context" + "k8s.io/apimachinery/pkg/types" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "k8s.io/apimachinery/pkg/types" ) func NewACS(main types.UID, cache inspectorInterface.Inspector) sutil.ACS { diff --git a/pkg/deployment/acs/sutil/interfaces.go b/pkg/deployment/acs/sutil/interfaces.go index 51604d5ac..1199ce642 100644 --- a/pkg/deployment/acs/sutil/interfaces.go +++ b/pkg/deployment/acs/sutil/interfaces.go @@ -23,10 +23,11 @@ package sutil import ( "context" + "k8s.io/apimachinery/pkg/types" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "k8s.io/apimachinery/pkg/types" ) type ACSGetter interface { diff --git a/pkg/deployment/agency/cache.go b/pkg/deployment/agency/cache.go index bc317f8e5..af8cf33de 100644 --- a/pkg/deployment/agency/cache.go +++ b/pkg/deployment/agency/cache.go @@ -26,6 +26,7 @@ import ( "github.com/arangodb/go-driver" "github.com/arangodb/go-driver/agency" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/generated/metric_descriptions" "github.com/arangodb/kube-arangodb/pkg/util/errors" diff --git a/pkg/deployment/agency/generator_database_test.go b/pkg/deployment/agency/generator_database_test.go index 00fcf144f..46752d498 100644 --- a/pkg/deployment/agency/generator_database_test.go +++ b/pkg/deployment/agency/generator_database_test.go @@ -25,9 +25,10 @@ import ( "strings" "testing" - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/dchest/uniuri" "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util" ) func NewDatabaseRandomGenerator() DatabaseGeneratorInterface { diff --git a/pkg/deployment/agency/state.go b/pkg/deployment/agency/state.go index 2eb0ba2df..dd73a2c55 100644 --- a/pkg/deployment/agency/state.go +++ b/pkg/deployment/agency/state.go @@ -27,6 +27,7 @@ import ( "github.com/arangodb/go-driver" "github.com/arangodb/go-driver/agency" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) diff --git a/pkg/deployment/chaos/context.go b/pkg/deployment/chaos/context.go index bf5ea50af..3faa34d86 100644 --- a/pkg/deployment/chaos/context.go +++ b/pkg/deployment/chaos/context.go @@ -23,9 +23,10 @@ package chaos import ( "context" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) // Context provides methods to the chaos package. diff --git a/pkg/deployment/chaos/monkey.go b/pkg/deployment/chaos/monkey.go index 90bc3fa8a..754ff3eca 100644 --- a/pkg/deployment/chaos/monkey.go +++ b/pkg/deployment/chaos/monkey.go @@ -25,11 +25,11 @@ import ( "math/rand" "time" + "github.com/rs/zerolog" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/rs/zerolog" ) var ( diff --git a/pkg/deployment/cleanup.go b/pkg/deployment/cleanup.go index 602bc8f2b..347afaeae 100644 --- a/pkg/deployment/cleanup.go +++ b/pkg/deployment/cleanup.go @@ -23,13 +23,12 @@ package deployment import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" pvcv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" diff --git a/pkg/deployment/client/client_cache.go b/pkg/deployment/client/client_cache.go index bfb388bfc..06e72cc6b 100644 --- a/pkg/deployment/client/client_cache.go +++ b/pkg/deployment/client/client_cache.go @@ -28,6 +28,7 @@ import ( driver "github.com/arangodb/go-driver" "github.com/arangodb/go-driver/agency" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/reconciler" diff --git a/pkg/deployment/cluster_scaling_integration.go b/pkg/deployment/cluster_scaling_integration.go index afd5f2eff..13971f40e 100644 --- a/pkg/deployment/cluster_scaling_integration.go +++ b/pkg/deployment/cluster_scaling_integration.go @@ -25,10 +25,6 @@ import ( "sync" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/rs/zerolog" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -36,6 +32,8 @@ import ( "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/arangod" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/context_impl.go b/pkg/deployment/context_impl.go index b94cead4e..68efb6dc5 100644 --- a/pkg/deployment/context_impl.go +++ b/pkg/deployment/context_impl.go @@ -28,44 +28,36 @@ import ( "strconv" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "k8s.io/apimachinery/pkg/types" - - "github.com/arangodb/kube-arangodb/pkg/deployment/patch" - - "github.com/arangodb/kube-arangodb/pkg/deployment/reconcile" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - - "github.com/arangodb/kube-arangodb/pkg/util/arangod/conn" - - "github.com/arangodb/kube-arangodb/pkg/operator/scope" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - "github.com/arangodb/go-driver/http" - "github.com/arangodb/go-driver/jwt" - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - - apiErrors "k8s.io/apimachinery/pkg/api/errors" - + "github.com/rs/zerolog/log" core "k8s.io/api/core/v1" + apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" "github.com/arangodb/arangosync-client/client" "github.com/arangodb/arangosync-client/tasks" driver "github.com/arangodb/go-driver" "github.com/arangodb/go-driver/agency" + "github.com/arangodb/go-driver/http" + "github.com/arangodb/go-driver/jwt" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/deployment/reconcile" "github.com/arangodb/kube-arangodb/pkg/deployment/reconciler" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" + "github.com/arangodb/kube-arangodb/pkg/operator/scope" + "github.com/arangodb/kube-arangodb/pkg/util/arangod/conn" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" persistentvolumeclaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" poddisruptionbudgetv1beta1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/poddisruptionbudget/v1beta1" @@ -74,7 +66,6 @@ import ( serviceaccountv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount/v1" servicemonitorv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor/v1" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/rs/zerolog/log" ) var _ resources.Context = &Deployment{} diff --git a/pkg/deployment/deployment_affinity_test.go b/pkg/deployment/deployment_affinity_test.go index 5cc93bae3..018e32a30 100644 --- a/pkg/deployment/deployment_affinity_test.go +++ b/pkg/deployment/deployment_affinity_test.go @@ -23,11 +23,12 @@ package deployment import ( "testing" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) func modifyAffinity(group string, required bool, role string, mods ...func(a *core.Affinity)) *core.Affinity { // nolint:unparam diff --git a/pkg/deployment/deployment_definitions_test.go b/pkg/deployment/deployment_definitions_test.go index d49a79b05..d9635521a 100644 --- a/pkg/deployment/deployment_definitions_test.go +++ b/pkg/deployment/deployment_definitions_test.go @@ -21,10 +21,11 @@ package deployment import ( - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util" core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util" ) var ( diff --git a/pkg/deployment/deployment_features_test.go b/pkg/deployment/deployment_features_test.go index d9ca611ba..771ce125a 100644 --- a/pkg/deployment/deployment_features_test.go +++ b/pkg/deployment/deployment_features_test.go @@ -23,11 +23,12 @@ package deployment import ( "testing" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) func TestEnsurePod_ArangoDB_Features(t *testing.T) { diff --git a/pkg/deployment/deployment_finalizers.go b/pkg/deployment/deployment_finalizers.go index 7bb300b25..b8bd8e6be 100644 --- a/pkg/deployment/deployment_finalizers.go +++ b/pkg/deployment/deployment_finalizers.go @@ -23,18 +23,15 @@ package deployment import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" ) // ensureFinalizers adds all required finalizers to the given deployment (in memory). diff --git a/pkg/deployment/deployment_image_test.go b/pkg/deployment/deployment_image_test.go index 7422870b4..f1656a669 100644 --- a/pkg/deployment/deployment_image_test.go +++ b/pkg/deployment/deployment_image_test.go @@ -23,15 +23,14 @@ package deployment import ( "testing" + core "k8s.io/api/core/v1" + "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - "github.com/arangodb/kube-arangodb/pkg/util" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func createTestDiscoveredImages(image, version, id string) api.ImageInfoList { diff --git a/pkg/deployment/deployment_inspector.go b/pkg/deployment/deployment_inspector.go index 6f5303a8c..1c1287421 100644 --- a/pkg/deployment/deployment_inspector.go +++ b/pkg/deployment/deployment_inspector.go @@ -24,25 +24,17 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/patch" - - operatorErrors "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/metrics" "github.com/arangodb/kube-arangodb/pkg/upgrade" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" ) var ( @@ -124,7 +116,7 @@ func (d *Deployment) inspectDeployment(lastInterval util.Interval) util.Interval inspectNextInterval, err := d.inspectDeploymentWithError(ctxReconciliation, nextInterval) if err != nil { - if !operatorErrors.IsReconcile(err) { + if !errors.IsReconcile(err) { nextInterval = inspectNextInterval hasError = true diff --git a/pkg/deployment/deployment_pod_probe_test.go b/pkg/deployment/deployment_pod_probe_test.go index 16467313d..71bbb91bb 100644 --- a/pkg/deployment/deployment_pod_probe_test.go +++ b/pkg/deployment/deployment_pod_probe_test.go @@ -23,11 +23,12 @@ package deployment import ( "testing" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) func TestEnsurePod_ArangoDB_Probe(t *testing.T) { diff --git a/pkg/deployment/deployment_pod_resources_test.go b/pkg/deployment/deployment_pod_resources_test.go index aad2bff72..9746ea77f 100644 --- a/pkg/deployment/deployment_pod_resources_test.go +++ b/pkg/deployment/deployment_pod_resources_test.go @@ -24,14 +24,14 @@ import ( "fmt" "testing" - "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) type envFunc func() []core.EnvVar diff --git a/pkg/deployment/deployment_pod_sync_test.go b/pkg/deployment/deployment_pod_sync_test.go index 7eaa01c67..8a0665e68 100644 --- a/pkg/deployment/deployment_pod_sync_test.go +++ b/pkg/deployment/deployment_pod_sync_test.go @@ -24,17 +24,16 @@ import ( "context" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func TestEnsurePod_Sync_Error(t *testing.T) { diff --git a/pkg/deployment/deployment_pod_tls_sni_test.go b/pkg/deployment/deployment_pod_tls_sni_test.go index 18714270a..5f34df1ad 100644 --- a/pkg/deployment/deployment_pod_tls_sni_test.go +++ b/pkg/deployment/deployment_pod_tls_sni_test.go @@ -25,15 +25,16 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" - "github.com/stretchr/testify/require" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func createTLSSNISecret(t *testing.T, client secretv1.ModInterface, name, namespace string) { diff --git a/pkg/deployment/deployment_pod_volumes_test.go b/pkg/deployment/deployment_pod_volumes_test.go index 11e8dfffc..29b92fa06 100644 --- a/pkg/deployment/deployment_pod_volumes_test.go +++ b/pkg/deployment/deployment_pod_volumes_test.go @@ -24,11 +24,12 @@ import ( "fmt" "testing" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) func createExampleVolume(name string) api.ServerGroupSpecVolume { diff --git a/pkg/deployment/deployment_run_test.go b/pkg/deployment/deployment_run_test.go index 1d9095324..4afe2111e 100644 --- a/pkg/deployment/deployment_run_test.go +++ b/pkg/deployment/deployment_run_test.go @@ -26,19 +26,17 @@ import ( "fmt" "testing" - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - "github.com/arangodb/kube-arangodb/pkg/deployment/resources" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" - - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func runTestCases(t *testing.T, testCases ...testCaseStruct) { diff --git a/pkg/deployment/deployment_suite_test.go b/pkg/deployment/deployment_suite_test.go index ea023f0ce..498d540ac 100644 --- a/pkg/deployment/deployment_suite_test.go +++ b/pkg/deployment/deployment_suite_test.go @@ -29,19 +29,21 @@ import ( "strings" "testing" - driver "github.com/arangodb/go-driver" - "github.com/arangodb/go-driver/jwt" - "github.com/arangodb/kube-arangodb/pkg/deployment/client" monitoringFakeClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/fake" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" + extfake "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" recordfake "k8s.io/client-go/tools/record" + driver "github.com/arangodb/go-driver" + "github.com/arangodb/go-driver/jwt" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/acs" + "github.com/arangodb/kube-arangodb/pkg/deployment/client" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/arangodb/kube-arangodb/pkg/deployment/resources/inspector" arangofake "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" @@ -51,7 +53,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/probes" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - extfake "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake" ) const ( diff --git a/pkg/deployment/features/local.go b/pkg/deployment/features/local.go index e65270c28..9498f29f2 100644 --- a/pkg/deployment/features/local.go +++ b/pkg/deployment/features/local.go @@ -24,8 +24,9 @@ import ( "fmt" "sync" - "github.com/arangodb/go-driver" "github.com/spf13/cobra" + + "github.com/arangodb/go-driver" ) var features = map[string]Feature{} diff --git a/pkg/deployment/images.go b/pkg/deployment/images.go index 6cd12aadb..bf8de090c 100644 --- a/pkg/deployment/images.go +++ b/pkg/deployment/images.go @@ -31,7 +31,6 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" diff --git a/pkg/deployment/images_test.go b/pkg/deployment/images_test.go index 0aa9d2ec0..123413d07 100644 --- a/pkg/deployment/images_test.go +++ b/pkg/deployment/images_test.go @@ -27,20 +27,17 @@ import ( "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - - "github.com/arangodb/kube-arangodb/pkg/deployment/resources" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/stretchr/testify/assert" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) const ( diff --git a/pkg/deployment/logger.go b/pkg/deployment/logger.go index c437a7c66..45257a13c 100644 --- a/pkg/deployment/logger.go +++ b/pkg/deployment/logger.go @@ -21,8 +21,9 @@ package deployment import ( - "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/rs/zerolog" + + "github.com/arangodb/kube-arangodb/pkg/logging" ) var ( diff --git a/pkg/deployment/member/phase_updates.go b/pkg/deployment/member/phase_updates.go index 8eee9b3da..f17f6c2e2 100644 --- a/pkg/deployment/member/phase_updates.go +++ b/pkg/deployment/member/phase_updates.go @@ -23,9 +23,10 @@ package member import ( "time" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) const ( diff --git a/pkg/deployment/member/state.go b/pkg/deployment/member/state.go index 6ad54de9c..d06862a16 100644 --- a/pkg/deployment/member/state.go +++ b/pkg/deployment/member/state.go @@ -27,6 +27,7 @@ import ( "github.com/rs/zerolog" "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/reconciler" "github.com/arangodb/kube-arangodb/pkg/logging" diff --git a/pkg/deployment/members.go b/pkg/deployment/members.go index 79463c6f1..885f8a760 100644 --- a/pkg/deployment/members.go +++ b/pkg/deployment/members.go @@ -23,18 +23,14 @@ package deployment import ( "context" - "k8s.io/apimachinery/pkg/util/uuid" - - "github.com/arangodb/kube-arangodb/pkg/deployment/reconcile" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/names" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/uuid" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/reconcile" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/names" ) func (d *Deployment) createAgencyMapping(ctx context.Context) error { diff --git a/pkg/deployment/old_metrics.go b/pkg/deployment/old_metrics.go index c916cdb51..3c005c012 100644 --- a/pkg/deployment/old_metrics.go +++ b/pkg/deployment/old_metrics.go @@ -23,11 +23,12 @@ package deployment import ( "sync" + "github.com/prometheus/client_golang/prometheus" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/generated/metric_descriptions" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" "github.com/arangodb/kube-arangodb/pkg/util/metrics" - "github.com/prometheus/client_golang/prometheus" ) const ( diff --git a/pkg/deployment/pod/affinity.go b/pkg/deployment/pod/affinity.go index 597242a30..3bf72f416 100644 --- a/pkg/deployment/pod/affinity.go +++ b/pkg/deployment/pod/affinity.go @@ -21,12 +21,13 @@ package pod import ( + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func AppendPodAntiAffinityDefault(p interfaces.PodCreator, a *core.PodAntiAffinity) { diff --git a/pkg/deployment/pod/builder.go b/pkg/deployment/pod/builder.go index 4cee47e0c..5e50066cf 100644 --- a/pkg/deployment/pod/builder.go +++ b/pkg/deployment/pod/builder.go @@ -21,12 +21,14 @@ package pod import ( + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/go-driver" + deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) type Input struct { diff --git a/pkg/deployment/pod/encryption.go b/pkg/deployment/pod/encryption.go index 13040609e..986b272d6 100644 --- a/pkg/deployment/pod/encryption.go +++ b/pkg/deployment/pod/encryption.go @@ -26,22 +26,18 @@ import ( "fmt" "path/filepath" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" ) func GroupEncryptionSupported(mode api.DeploymentMode, group api.ServerGroup) bool { diff --git a/pkg/deployment/pod/jwt.go b/pkg/deployment/pod/jwt.go index 3215420a9..cb7d62a5b 100644 --- a/pkg/deployment/pod/jwt.go +++ b/pkg/deployment/pod/jwt.go @@ -24,18 +24,16 @@ import ( "fmt" "path/filepath" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" + core "k8s.io/api/core/v1" "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/apis/shared" - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" ) const ActiveJWTKey = "-" diff --git a/pkg/deployment/pod/security.go b/pkg/deployment/pod/security.go index 931258496..13d6c544f 100644 --- a/pkg/deployment/pod/security.go +++ b/pkg/deployment/pod/security.go @@ -21,11 +21,12 @@ package pod import ( + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - core "k8s.io/api/core/v1" ) func Security() Builder { diff --git a/pkg/deployment/pod/sni.go b/pkg/deployment/pod/sni.go index 148e30e63..eb913833f 100644 --- a/pkg/deployment/pod/sni.go +++ b/pkg/deployment/pod/sni.go @@ -24,20 +24,16 @@ import ( "crypto/sha256" "fmt" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" + core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - + "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" ) func GroupSNISupported(mode api.DeploymentMode, group api.ServerGroup) bool { diff --git a/pkg/deployment/pod/tls.go b/pkg/deployment/pod/tls.go index 9651aa1dd..f8e0524a2 100644 --- a/pkg/deployment/pod/tls.go +++ b/pkg/deployment/pod/tls.go @@ -23,16 +23,14 @@ package pod import ( "path/filepath" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" + core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" ) func IsRuntimeTLSKeyfileUpdateSupported(i Input) bool { diff --git a/pkg/deployment/pod/topology.community.go b/pkg/deployment/pod/topology.community.go index f03491705..205a4f3f0 100644 --- a/pkg/deployment/pod/topology.community.go +++ b/pkg/deployment/pod/topology.community.go @@ -22,9 +22,10 @@ package pod import ( + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - core "k8s.io/api/core/v1" ) func (t topology) Args(i Input) k8sutil.OptionPairs { diff --git a/pkg/deployment/pod/upgrade.go b/pkg/deployment/pod/upgrade.go index 03573769e..6ec08a808 100644 --- a/pkg/deployment/pod/upgrade.go +++ b/pkg/deployment/pod/upgrade.go @@ -21,10 +21,11 @@ package pod import ( + core "k8s.io/api/core/v1" + deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - core "k8s.io/api/core/v1" ) func AutoUpgrade() Builder { diff --git a/pkg/deployment/pod/upgrade_version_check.go b/pkg/deployment/pod/upgrade_version_check.go index 8ddc89741..53bbd35ce 100644 --- a/pkg/deployment/pod/upgrade_version_check.go +++ b/pkg/deployment/pod/upgrade_version_check.go @@ -21,11 +21,12 @@ package pod import ( + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - core "k8s.io/api/core/v1" ) func UpgradeVersionCheck() Builder { diff --git a/pkg/deployment/pod/utils.go b/pkg/deployment/pod/utils.go index abc19b44f..f67208f1c 100644 --- a/pkg/deployment/pod/utils.go +++ b/pkg/deployment/pod/utils.go @@ -21,12 +21,13 @@ package pod import ( + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func GenerateMemberEndpoint(services service.Inspector, apiObject meta.Object, spec api.DeploymentSpec, group api.ServerGroup, member api.MemberStatus) (string, error) { diff --git a/pkg/deployment/reconcile/action.go b/pkg/deployment/reconcile/action.go index 444e7d386..0b1884007 100644 --- a/pkg/deployment/reconcile/action.go +++ b/pkg/deployment/reconcile/action.go @@ -26,9 +26,10 @@ import ( "sync" "time" + "k8s.io/apimachinery/pkg/types" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - "k8s.io/apimachinery/pkg/types" ) const ( diff --git a/pkg/deployment/reconcile/action_add_member.go b/pkg/deployment/reconcile/action_add_member.go index affab90e0..aefc0740e 100644 --- a/pkg/deployment/reconcile/action_add_member.go +++ b/pkg/deployment/reconcile/action_add_member.go @@ -23,12 +23,10 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/deployment/topology" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/deployment/topology" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func init() { diff --git a/pkg/deployment/reconcile/action_backup_restore.go b/pkg/deployment/reconcile/action_backup_restore.go index c3492a903..2dc566ce6 100644 --- a/pkg/deployment/reconcile/action_backup_restore.go +++ b/pkg/deployment/reconcile/action_backup_restore.go @@ -23,13 +23,13 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/arangod/conn" "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_bootstrap_set_password.go b/pkg/deployment/reconcile/action_bootstrap_set_password.go index ad2304496..fe379f7b1 100644 --- a/pkg/deployment/reconcile/action_bootstrap_set_password.go +++ b/pkg/deployment/reconcile/action_bootstrap_set_password.go @@ -25,13 +25,12 @@ import ( "crypto/rand" "encoding/hex" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/reconcile/action_cleanout_member.go b/pkg/deployment/reconcile/action_cleanout_member.go index c41565d0a..844de48db 100644 --- a/pkg/deployment/reconcile/action_cleanout_member.go +++ b/pkg/deployment/reconcile/action_cleanout_member.go @@ -23,13 +23,12 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - driver "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/agency" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_cluster_member_cleanup.go b/pkg/deployment/reconcile/action_cluster_member_cleanup.go index c895b0699..b10a011f3 100644 --- a/pkg/deployment/reconcile/action_cluster_member_cleanup.go +++ b/pkg/deployment/reconcile/action_cluster_member_cleanup.go @@ -23,11 +23,10 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/arangodb/go-driver" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_context.go b/pkg/deployment/reconcile/action_context.go index 814119fa2..89d71a354 100644 --- a/pkg/deployment/reconcile/action_context.go +++ b/pkg/deployment/reconcile/action_context.go @@ -24,10 +24,11 @@ import ( "context" "time" - "github.com/arangodb/arangosync-client/client" core "k8s.io/api/core/v1" + "github.com/arangodb/arangosync-client/client" "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" diff --git a/pkg/deployment/reconcile/action_encryption_add.go b/pkg/deployment/reconcile/action_encryption_add.go index a6f72b261..81d24fbe6 100644 --- a/pkg/deployment/reconcile/action_encryption_add.go +++ b/pkg/deployment/reconcile/action_encryption_add.go @@ -24,20 +24,15 @@ import ( "context" "encoding/base64" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - "github.com/arangodb/kube-arangodb/pkg/deployment/patch" - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func ensureEncryptionSupport(actionCtx ActionContext) error { diff --git a/pkg/deployment/reconcile/action_encryption_refresh.go b/pkg/deployment/reconcile/action_encryption_refresh.go index 1d90b664f..58b44daf3 100644 --- a/pkg/deployment/reconcile/action_encryption_refresh.go +++ b/pkg/deployment/reconcile/action_encryption_refresh.go @@ -23,13 +23,12 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/client" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_encryption_remove.go b/pkg/deployment/reconcile/action_encryption_remove.go index 81ba017ef..5dd53af53 100644 --- a/pkg/deployment/reconcile/action_encryption_remove.go +++ b/pkg/deployment/reconcile/action_encryption_remove.go @@ -23,19 +23,15 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/patch" - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func init() { diff --git a/pkg/deployment/reconcile/action_encryption_status_update.go b/pkg/deployment/reconcile/action_encryption_status_update.go index 203dc0871..09d14d59b 100644 --- a/pkg/deployment/reconcile/action_encryption_status_update.go +++ b/pkg/deployment/reconcile/action_encryption_status_update.go @@ -23,13 +23,12 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_jwt_add.go b/pkg/deployment/reconcile/action_jwt_add.go index d847ffd2c..450d522e9 100644 --- a/pkg/deployment/reconcile/action_jwt_add.go +++ b/pkg/deployment/reconcile/action_jwt_add.go @@ -24,20 +24,17 @@ import ( "context" "encoding/base64" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/util/constants" + "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/apimachinery/pkg/types" ) func init() { diff --git a/pkg/deployment/reconcile/action_jwt_clean.go b/pkg/deployment/reconcile/action_jwt_clean.go index 146ecf667..965690987 100644 --- a/pkg/deployment/reconcile/action_jwt_clean.go +++ b/pkg/deployment/reconcile/action_jwt_clean.go @@ -23,18 +23,16 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" + "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/apimachinery/pkg/types" ) func init() { diff --git a/pkg/deployment/reconcile/action_jwt_refresh.go b/pkg/deployment/reconcile/action_jwt_refresh.go index 2eb2d001e..9cecddda6 100644 --- a/pkg/deployment/reconcile/action_jwt_refresh.go +++ b/pkg/deployment/reconcile/action_jwt_refresh.go @@ -23,11 +23,10 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/client" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_jwt_set_active.go b/pkg/deployment/reconcile/action_jwt_set_active.go index ff56824a3..2afb44c3c 100644 --- a/pkg/deployment/reconcile/action_jwt_set_active.go +++ b/pkg/deployment/reconcile/action_jwt_set_active.go @@ -24,20 +24,17 @@ import ( "context" "encoding/base64" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/util/constants" + "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/apimachinery/pkg/types" ) func init() { diff --git a/pkg/deployment/reconcile/action_jwt_status_update.go b/pkg/deployment/reconcile/action_jwt_status_update.go index d97877a9a..850e8aa73 100644 --- a/pkg/deployment/reconcile/action_jwt_status_update.go +++ b/pkg/deployment/reconcile/action_jwt_status_update.go @@ -25,15 +25,12 @@ import ( "fmt" "sort" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - "github.com/arangodb/kube-arangodb/pkg/util/constants" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/deployment/reconcile/action_member_phase_update.go b/pkg/deployment/reconcile/action_member_phase_update.go index bf24e454d..2d0529f0f 100644 --- a/pkg/deployment/reconcile/action_member_phase_update.go +++ b/pkg/deployment/reconcile/action_member_phase_update.go @@ -23,9 +23,8 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/deployment/member" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/member" "github.com/arangodb/kube-arangodb/pkg/util/errors" ) diff --git a/pkg/deployment/reconcile/action_pvc_resize.go b/pkg/deployment/reconcile/action_pvc_resize.go index f05c7828f..f48fa76bf 100644 --- a/pkg/deployment/reconcile/action_pvc_resize.go +++ b/pkg/deployment/reconcile/action_pvc_resize.go @@ -23,12 +23,13 @@ package reconcile import ( "context" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/reconcile/action_pvc_resized.go b/pkg/deployment/reconcile/action_pvc_resized.go index 87010cc2b..381776df0 100644 --- a/pkg/deployment/reconcile/action_pvc_resized.go +++ b/pkg/deployment/reconcile/action_pvc_resized.go @@ -23,9 +23,10 @@ package reconcile import ( "context" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) func init() { diff --git a/pkg/deployment/reconcile/action_recreate_member.go b/pkg/deployment/reconcile/action_recreate_member.go index b25c3862b..5447f1a49 100644 --- a/pkg/deployment/reconcile/action_recreate_member.go +++ b/pkg/deployment/reconcile/action_recreate_member.go @@ -23,9 +23,8 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func init() { diff --git a/pkg/deployment/reconcile/action_remove_member.go b/pkg/deployment/reconcile/action_remove_member.go index b4ecb1ddd..791a9c721 100644 --- a/pkg/deployment/reconcile/action_remove_member.go +++ b/pkg/deployment/reconcile/action_remove_member.go @@ -27,6 +27,7 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/arangod" "github.com/arangodb/kube-arangodb/pkg/util/errors" diff --git a/pkg/deployment/reconcile/action_resign_leadership.go b/pkg/deployment/reconcile/action_resign_leadership.go index a00f01010..60d697965 100644 --- a/pkg/deployment/reconcile/action_resign_leadership.go +++ b/pkg/deployment/reconcile/action_resign_leadership.go @@ -23,13 +23,12 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/util/errors" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/agency" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_rotate_member.go b/pkg/deployment/reconcile/action_rotate_member.go index 970cc356a..6ba390c41 100644 --- a/pkg/deployment/reconcile/action_rotate_member.go +++ b/pkg/deployment/reconcile/action_rotate_member.go @@ -22,11 +22,10 @@ package reconcile import ( "context" + "time" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "time" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" diff --git a/pkg/deployment/reconcile/action_rotate_start_member.go b/pkg/deployment/reconcile/action_rotate_start_member.go index ec6057cf7..19982427b 100644 --- a/pkg/deployment/reconcile/action_rotate_start_member.go +++ b/pkg/deployment/reconcile/action_rotate_start_member.go @@ -22,11 +22,10 @@ package reconcile import ( "context" + "time" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "time" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" diff --git a/pkg/deployment/reconcile/action_rotate_stop_member.go b/pkg/deployment/reconcile/action_rotate_stop_member.go index 6513c02ad..65779b9a2 100644 --- a/pkg/deployment/reconcile/action_rotate_stop_member.go +++ b/pkg/deployment/reconcile/action_rotate_stop_member.go @@ -23,9 +23,8 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func init() { diff --git a/pkg/deployment/reconcile/action_runtime_container_args_udpate.go b/pkg/deployment/reconcile/action_runtime_container_args_udpate.go index c368b6a03..a8f9e4dff 100644 --- a/pkg/deployment/reconcile/action_runtime_container_args_udpate.go +++ b/pkg/deployment/reconcile/action_runtime_container_args_udpate.go @@ -25,13 +25,12 @@ import ( "fmt" "strings" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/pkg/errors" core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/rotation" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" ) diff --git a/pkg/deployment/reconcile/action_runtime_container_image_update.go b/pkg/deployment/reconcile/action_runtime_container_image_update.go index 20dec2023..570bd755b 100644 --- a/pkg/deployment/reconcile/action_runtime_container_image_update.go +++ b/pkg/deployment/reconcile/action_runtime_container_image_update.go @@ -24,13 +24,13 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/rotation" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/reconcile/action_set_current_image.go b/pkg/deployment/reconcile/action_set_current_image.go index dfad5a801..ac1fd4354 100644 --- a/pkg/deployment/reconcile/action_set_current_image.go +++ b/pkg/deployment/reconcile/action_set_current_image.go @@ -23,9 +23,8 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func init() { diff --git a/pkg/deployment/reconcile/action_set_license.go b/pkg/deployment/reconcile/action_set_license.go index 3f8434248..941e0c916 100644 --- a/pkg/deployment/reconcile/action_set_license.go +++ b/pkg/deployment/reconcile/action_set_license.go @@ -23,12 +23,10 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/deployment/client" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/client" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func init() { diff --git a/pkg/deployment/reconcile/action_shutdown_member.go b/pkg/deployment/reconcile/action_shutdown_member.go index 1ac00f0d3..e8e8d9b12 100644 --- a/pkg/deployment/reconcile/action_shutdown_member.go +++ b/pkg/deployment/reconcile/action_shutdown_member.go @@ -22,12 +22,10 @@ package reconcile import ( "context" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "time" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func init() { diff --git a/pkg/deployment/reconcile/action_tls_ca_append.go b/pkg/deployment/reconcile/action_tls_ca_append.go index d699eba1c..01fd8c4ef 100644 --- a/pkg/deployment/reconcile/action_tls_ca_append.go +++ b/pkg/deployment/reconcile/action_tls_ca_append.go @@ -24,20 +24,16 @@ import ( "context" "encoding/base64" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/patch" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func init() { diff --git a/pkg/deployment/reconcile/action_tls_ca_clean.go b/pkg/deployment/reconcile/action_tls_ca_clean.go index 55dfba32b..f472ab50b 100644 --- a/pkg/deployment/reconcile/action_tls_ca_clean.go +++ b/pkg/deployment/reconcile/action_tls_ca_clean.go @@ -23,20 +23,16 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/patch" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func init() { diff --git a/pkg/deployment/reconcile/action_tls_ca_renew.go b/pkg/deployment/reconcile/action_tls_ca_renew.go index 4148745b1..99a6927da 100644 --- a/pkg/deployment/reconcile/action_tls_ca_renew.go +++ b/pkg/deployment/reconcile/action_tls_ca_renew.go @@ -23,11 +23,11 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/reconcile/action_tls_keyfile_clean.go b/pkg/deployment/reconcile/action_tls_keyfile_clean.go index f0d22379d..25c4acaa0 100644 --- a/pkg/deployment/reconcile/action_tls_keyfile_clean.go +++ b/pkg/deployment/reconcile/action_tls_keyfile_clean.go @@ -23,11 +23,11 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/globals" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func init() { diff --git a/pkg/deployment/reconcile/action_tls_keyfile_refresh.go b/pkg/deployment/reconcile/action_tls_keyfile_refresh.go index ceb41bcee..388ca22a8 100644 --- a/pkg/deployment/reconcile/action_tls_keyfile_refresh.go +++ b/pkg/deployment/reconcile/action_tls_keyfile_refresh.go @@ -23,15 +23,12 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/client" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" - + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) func init() { diff --git a/pkg/deployment/reconcile/action_tls_sni_update.go b/pkg/deployment/reconcile/action_tls_sni_update.go index 5461d882d..58c666fc4 100644 --- a/pkg/deployment/reconcile/action_tls_sni_update.go +++ b/pkg/deployment/reconcile/action_tls_sni_update.go @@ -23,9 +23,8 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_tls_status_update.go b/pkg/deployment/reconcile/action_tls_status_update.go index 79814cf12..8413516b0 100644 --- a/pkg/deployment/reconcile/action_tls_status_update.go +++ b/pkg/deployment/reconcile/action_tls_status_update.go @@ -23,13 +23,12 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/deployment/resources" - "github.com/arangodb/kube-arangodb/pkg/util" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/action_upgrade_current_image.go b/pkg/deployment/reconcile/action_upgrade_current_image.go index 23084e804..c542f5f07 100644 --- a/pkg/deployment/reconcile/action_upgrade_current_image.go +++ b/pkg/deployment/reconcile/action_upgrade_current_image.go @@ -23,9 +23,8 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func init() { diff --git a/pkg/deployment/reconcile/action_upgrade_member.go b/pkg/deployment/reconcile/action_upgrade_member.go index a6bc2e32f..93709d31a 100644 --- a/pkg/deployment/reconcile/action_upgrade_member.go +++ b/pkg/deployment/reconcile/action_upgrade_member.go @@ -23,9 +23,8 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func init() { diff --git a/pkg/deployment/reconcile/action_wait_for_member_in_sync.go b/pkg/deployment/reconcile/action_wait_for_member_in_sync.go index 68055b23e..67d460093 100644 --- a/pkg/deployment/reconcile/action_wait_for_member_in_sync.go +++ b/pkg/deployment/reconcile/action_wait_for_member_in_sync.go @@ -23,10 +23,9 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/agency" + "github.com/arangodb/kube-arangodb/pkg/util" ) func init() { diff --git a/pkg/deployment/reconcile/action_wait_for_member_up.go b/pkg/deployment/reconcile/action_wait_for_member_up.go index 7169ec8e3..baeaee982 100644 --- a/pkg/deployment/reconcile/action_wait_for_member_up.go +++ b/pkg/deployment/reconcile/action_wait_for_member_up.go @@ -23,12 +23,11 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - driver "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func init() { diff --git a/pkg/deployment/reconcile/helper_shutdown.go b/pkg/deployment/reconcile/helper_shutdown.go index e2fe65d96..64db20c69 100644 --- a/pkg/deployment/reconcile/helper_shutdown.go +++ b/pkg/deployment/reconcile/helper_shutdown.go @@ -23,10 +23,9 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/util" diff --git a/pkg/deployment/reconcile/helper_tls_sni.go b/pkg/deployment/reconcile/helper_tls_sni.go index 62b23cfe8..e2c0006f8 100644 --- a/pkg/deployment/reconcile/helper_tls_sni.go +++ b/pkg/deployment/reconcile/helper_tls_sni.go @@ -25,14 +25,13 @@ import ( "crypto/sha256" "fmt" - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/client" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" ) func mapTLSSNIConfig(sni api.TLSSNISpec, cachedStatus inspectorInterface.Inspector) (map[string]string, error) { diff --git a/pkg/deployment/reconcile/plan_builder_appender_test.go b/pkg/deployment/reconcile/plan_builder_appender_test.go index b3f25ec24..da6dcbacf 100644 --- a/pkg/deployment/reconcile/plan_builder_appender_test.go +++ b/pkg/deployment/reconcile/plan_builder_appender_test.go @@ -24,9 +24,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "github.com/stretchr/testify/require" ) func Test_PlanBuilderAppender_Recovery(t *testing.T) { diff --git a/pkg/deployment/reconcile/plan_builder_clean_out.go b/pkg/deployment/reconcile/plan_builder_clean_out.go index 97df34731..7be96c157 100644 --- a/pkg/deployment/reconcile/plan_builder_clean_out.go +++ b/pkg/deployment/reconcile/plan_builder_clean_out.go @@ -24,11 +24,11 @@ import ( "context" "strconv" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/reconcile/plan_builder_cluster.go b/pkg/deployment/reconcile/plan_builder_cluster.go index b216188ff..2c3aa57ed 100644 --- a/pkg/deployment/reconcile/plan_builder_cluster.go +++ b/pkg/deployment/reconcile/plan_builder_cluster.go @@ -24,11 +24,11 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/reconcile/plan_builder_common.go b/pkg/deployment/reconcile/plan_builder_common.go index 378ceb382..d3a7eed7b 100644 --- a/pkg/deployment/reconcile/plan_builder_common.go +++ b/pkg/deployment/reconcile/plan_builder_common.go @@ -22,7 +22,6 @@ package reconcile import ( "context" - "time" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" diff --git a/pkg/deployment/reconcile/plan_builder_context.go b/pkg/deployment/reconcile/plan_builder_context.go index dfea98951..fdb856f9e 100644 --- a/pkg/deployment/reconcile/plan_builder_context.go +++ b/pkg/deployment/reconcile/plan_builder_context.go @@ -23,12 +23,10 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/arangod/conn" - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" "github.com/arangodb/kube-arangodb/pkg/deployment/reconciler" + "github.com/arangodb/kube-arangodb/pkg/util/arangod/conn" ) // PlanBuilderContext contains context methods provided to plan builders. diff --git a/pkg/deployment/reconcile/plan_builder_encryption.go b/pkg/deployment/reconcile/plan_builder_encryption.go index 6b1c05fbf..9bed474a9 100644 --- a/pkg/deployment/reconcile/plan_builder_encryption.go +++ b/pkg/deployment/reconcile/plan_builder_encryption.go @@ -23,19 +23,16 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" core "k8s.io/api/core/v1" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - "github.com/arangodb/kube-arangodb/pkg/deployment/client" - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/deployment/client" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func skipEncryptionPlan(spec api.DeploymentSpec, status api.DeploymentStatus) bool { diff --git a/pkg/deployment/reconcile/plan_builder_high.go b/pkg/deployment/reconcile/plan_builder_high.go index 31eb4f673..d1303f46e 100644 --- a/pkg/deployment/reconcile/plan_builder_high.go +++ b/pkg/deployment/reconcile/plan_builder_high.go @@ -24,12 +24,12 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/deployment/rotation" + core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/deployment/rotation" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) // createHighPlan considers the given specification & status and creates a plan to get the status in line with the specification. diff --git a/pkg/deployment/reconcile/plan_builder_jwt.go b/pkg/deployment/reconcile/plan_builder_jwt.go index 06996828b..05db27037 100644 --- a/pkg/deployment/reconcile/plan_builder_jwt.go +++ b/pkg/deployment/reconcile/plan_builder_jwt.go @@ -26,18 +26,16 @@ import ( "sort" "time" - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/client" - core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/deployment/client" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/reconcile/plan_builder_restore.go b/pkg/deployment/reconcile/plan_builder_restore.go index 400d12c45..423185520 100644 --- a/pkg/deployment/reconcile/plan_builder_restore.go +++ b/pkg/deployment/reconcile/plan_builder_restore.go @@ -23,10 +23,9 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go index 214723886..3e57ff04a 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go @@ -22,22 +22,21 @@ package reconcile import ( "context" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - "github.com/arangodb/kube-arangodb/pkg/deployment/resources" - "fmt" + core "k8s.io/api/core/v1" + "github.com/arangodb/go-driver" upgraderules "github.com/arangodb/go-upgrade-rules" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" "github.com/arangodb/kube-arangodb/pkg/deployment/agency" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/arangodb/kube-arangodb/pkg/deployment/rotation" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) var ( diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go index d86361be4..22e8b4e63 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go @@ -23,10 +23,12 @@ package reconcile import ( "testing" + "github.com/stretchr/testify/require" + "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/stretchr/testify/require" ) func Test_RotateUpgrade_Condition(t *testing.T) { diff --git a/pkg/deployment/reconcile/plan_builder_storage.go b/pkg/deployment/reconcile/plan_builder_storage.go index a1fc99dc9..46e8471c7 100644 --- a/pkg/deployment/reconcile/plan_builder_storage.go +++ b/pkg/deployment/reconcile/plan_builder_storage.go @@ -23,10 +23,11 @@ package reconcile import ( "context" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) // createRotateServerStorageResizePlan creates plan to resize storage diff --git a/pkg/deployment/reconcile/plan_builder_test.go b/pkg/deployment/reconcile/plan_builder_test.go index 3f7c1742a..16a0dd26d 100644 --- a/pkg/deployment/reconcile/plan_builder_test.go +++ b/pkg/deployment/reconcile/plan_builder_test.go @@ -36,9 +36,9 @@ import ( "k8s.io/client-go/kubernetes" "github.com/arangodb/arangosync-client/client" + "github.com/arangodb/go-driver" "github.com/arangodb/go-driver/agency" - "github.com/arangodb/go-driver" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/acs" diff --git a/pkg/deployment/reconcile/plan_builder_tls_sni.go b/pkg/deployment/reconcile/plan_builder_tls_sni.go index c7c253072..0cd141042 100644 --- a/pkg/deployment/reconcile/plan_builder_tls_sni.go +++ b/pkg/deployment/reconcile/plan_builder_tls_sni.go @@ -23,15 +23,14 @@ package reconcile import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) func (r *Reconciler) createRotateTLSServerSNIPlan(ctx context.Context, apiObject k8sutil.APIObject, diff --git a/pkg/deployment/reconcile/utils.go b/pkg/deployment/reconcile/utils.go index 9fb8f3122..34f0a55aa 100644 --- a/pkg/deployment/reconcile/utils.go +++ b/pkg/deployment/reconcile/utils.go @@ -24,16 +24,16 @@ import ( "context" "sort" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod" - "k8s.io/apimachinery/pkg/types" ) func secretKeysToListWithPrefix(s *core.Secret) []string { diff --git a/pkg/deployment/reconciler/context.go b/pkg/deployment/reconciler/context.go index b1f0ca5b9..7059a662c 100644 --- a/pkg/deployment/reconciler/context.go +++ b/pkg/deployment/reconciler/context.go @@ -27,6 +27,7 @@ import ( "github.com/arangodb/arangosync-client/client" "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" agencyCache "github.com/arangodb/kube-arangodb/pkg/deployment/agency" diff --git a/pkg/deployment/reconciler/context_arangomember.go b/pkg/deployment/reconciler/context_arangomember.go index 78ee561ee..e484a9242 100644 --- a/pkg/deployment/reconciler/context_arangomember.go +++ b/pkg/deployment/reconciler/context_arangomember.go @@ -24,10 +24,11 @@ import ( "context" "time" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) type ArangoMemberCreateFunc func(obj *api.ArangoMember) diff --git a/pkg/deployment/resilience/logger.go b/pkg/deployment/resilience/logger.go index b26d1613e..e59bb5e96 100644 --- a/pkg/deployment/resilience/logger.go +++ b/pkg/deployment/resilience/logger.go @@ -21,8 +21,9 @@ package resilience import ( - "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/rs/zerolog" + + "github.com/arangodb/kube-arangodb/pkg/logging" ) var ( diff --git a/pkg/deployment/resilience/member_failure.go b/pkg/deployment/resilience/member_failure.go index 80b610dfe..5d0d9190f 100644 --- a/pkg/deployment/resilience/member_failure.go +++ b/pkg/deployment/resilience/member_failure.go @@ -24,10 +24,9 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/agency" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/deployment/resources/certicicates.go b/pkg/deployment/resources/certicicates.go index 2309cf8d7..472d6f2a5 100644 --- a/pkg/deployment/resources/certicicates.go +++ b/pkg/deployment/resources/certicicates.go @@ -25,13 +25,13 @@ import ( "crypto/x509" "encoding/pem" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" + core "k8s.io/api/core/v1" "github.com/arangodb-helper/go-certificates" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" ) type Certificates []*x509.Certificate diff --git a/pkg/deployment/resources/certificates_client_auth.go b/pkg/deployment/resources/certificates_client_auth.go index e5e8c51c3..a25c16e1a 100644 --- a/pkg/deployment/resources/certificates_client_auth.go +++ b/pkg/deployment/resources/certificates_client_auth.go @@ -28,6 +28,7 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" certificates "github.com/arangodb-helper/go-certificates" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" diff --git a/pkg/deployment/resources/certificates_tls.go b/pkg/deployment/resources/certificates_tls.go index 2ce39b301..31487b1bd 100644 --- a/pkg/deployment/resources/certificates_tls.go +++ b/pkg/deployment/resources/certificates_tls.go @@ -26,19 +26,18 @@ import ( "strings" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" certificates "github.com/arangodb-helper/go-certificates" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" ) const ( diff --git a/pkg/deployment/resources/context.go b/pkg/deployment/resources/context.go index a392e3e45..24394da25 100644 --- a/pkg/deployment/resources/context.go +++ b/pkg/deployment/resources/context.go @@ -23,6 +23,8 @@ package resources import ( "context" + core "k8s.io/api/core/v1" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" @@ -30,7 +32,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/reconciler" "github.com/arangodb/kube-arangodb/pkg/operator/scope" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) // Context provides all functions needed by the Resources service diff --git a/pkg/deployment/resources/exporter.go b/pkg/deployment/resources/exporter.go index 948e85ca1..7588d5d38 100644 --- a/pkg/deployment/resources/exporter.go +++ b/pkg/deployment/resources/exporter.go @@ -21,15 +21,15 @@ package resources import ( "path/filepath" + core "k8s.io/api/core/v1" + "github.com/arangodb/go-driver" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/probes" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/probes" ) // ArangodbExporterContainer creates metrics container diff --git a/pkg/deployment/resources/inspector/acs.go b/pkg/deployment/resources/inspector/acs.go index 02f6dd9f2..e66b657fd 100644 --- a/pkg/deployment/resources/inspector/acs.go +++ b/pkg/deployment/resources/inspector/acs.go @@ -24,11 +24,12 @@ import ( "context" "time" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/acs_anonymous.go b/pkg/deployment/resources/inspector/acs_anonymous.go index af63a09d6..d3b008635 100644 --- a/pkg/deployment/resources/inspector/acs_anonymous.go +++ b/pkg/deployment/resources/inspector/acs_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *arangoClusterSynchronizationsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/acs_constants.go b/pkg/deployment/resources/inspector/acs_constants.go index 755dcb2ec..3243b2bef 100644 --- a/pkg/deployment/resources/inspector/acs_constants.go +++ b/pkg/deployment/resources/inspector/acs_constants.go @@ -21,9 +21,10 @@ package inspector import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "k8s.io/apimachinery/pkg/runtime/schema" ) // ArangoClusterSynchronization diff --git a/pkg/deployment/resources/inspector/acs_v1.go b/pkg/deployment/resources/inspector/acs_v1.go index e61794f91..0911f23eb 100644 --- a/pkg/deployment/resources/inspector/acs_v1.go +++ b/pkg/deployment/resources/inspector/acs_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization/v1" - apiErrors "k8s.io/apimachinery/pkg/api/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func (p *arangoClusterSynchronizationsInspector) V1() (ins.Inspector, error) { diff --git a/pkg/deployment/resources/inspector/ad_constants.go b/pkg/deployment/resources/inspector/ad_constants.go index 99154173d..335b4f91c 100644 --- a/pkg/deployment/resources/inspector/ad_constants.go +++ b/pkg/deployment/resources/inspector/ad_constants.go @@ -21,9 +21,10 @@ package inspector import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "k8s.io/apimachinery/pkg/runtime/schema" ) // ArangoDeployment diff --git a/pkg/deployment/resources/inspector/am.go b/pkg/deployment/resources/inspector/am.go index 7e7a5ec1d..8a6d13ccb 100644 --- a/pkg/deployment/resources/inspector/am.go +++ b/pkg/deployment/resources/inspector/am.go @@ -24,11 +24,12 @@ import ( "context" "time" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/am_anonymous.go b/pkg/deployment/resources/inspector/am_anonymous.go index 7e37e1e74..124a57c86 100644 --- a/pkg/deployment/resources/inspector/am_anonymous.go +++ b/pkg/deployment/resources/inspector/am_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *arangoMembersInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/am_constants.go b/pkg/deployment/resources/inspector/am_constants.go index 41fdfc99c..69148c3c4 100644 --- a/pkg/deployment/resources/inspector/am_constants.go +++ b/pkg/deployment/resources/inspector/am_constants.go @@ -21,9 +21,10 @@ package inspector import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "k8s.io/apimachinery/pkg/runtime/schema" ) // ArangoMember diff --git a/pkg/deployment/resources/inspector/am_v1.go b/pkg/deployment/resources/inspector/am_v1.go index e5a6084ad..d4fdb4172 100644 --- a/pkg/deployment/resources/inspector/am_v1.go +++ b/pkg/deployment/resources/inspector/am_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember/v1" - apiErrors "k8s.io/apimachinery/pkg/api/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func (p *arangoMembersInspector) V1() ins.Inspector { diff --git a/pkg/deployment/resources/inspector/at.go b/pkg/deployment/resources/inspector/at.go index 7666b4066..e6d604bde 100644 --- a/pkg/deployment/resources/inspector/at.go +++ b/pkg/deployment/resources/inspector/at.go @@ -24,11 +24,12 @@ import ( "context" "time" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/at_anonymous.go b/pkg/deployment/resources/inspector/at_anonymous.go index 59576de31..1f9279451 100644 --- a/pkg/deployment/resources/inspector/at_anonymous.go +++ b/pkg/deployment/resources/inspector/at_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *arangoTasksInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/at_constants.go b/pkg/deployment/resources/inspector/at_constants.go index 4550e0958..0b019f100 100644 --- a/pkg/deployment/resources/inspector/at_constants.go +++ b/pkg/deployment/resources/inspector/at_constants.go @@ -21,9 +21,10 @@ package inspector import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "k8s.io/apimachinery/pkg/runtime/schema" ) // ArangoTask diff --git a/pkg/deployment/resources/inspector/at_v1.go b/pkg/deployment/resources/inspector/at_v1.go index 2e12216d1..00352b578 100644 --- a/pkg/deployment/resources/inspector/at_v1.go +++ b/pkg/deployment/resources/inspector/at_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/errors" ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask/v1" - apiErrors "k8s.io/apimachinery/pkg/api/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func (p *arangoTasksInspector) V1() (ins.Inspector, error) { diff --git a/pkg/deployment/resources/inspector/endpoints.go b/pkg/deployment/resources/inspector/endpoints.go index 8a00185a4..ad3a0b9ce 100644 --- a/pkg/deployment/resources/inspector/endpoints.go +++ b/pkg/deployment/resources/inspector/endpoints.go @@ -24,11 +24,12 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/endpoints_anonymous.go b/pkg/deployment/resources/inspector/endpoints_anonymous.go index 09aa356ce..5a36f94d8 100644 --- a/pkg/deployment/resources/inspector/endpoints_anonymous.go +++ b/pkg/deployment/resources/inspector/endpoints_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *endpointsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/endpoints_mod_v1.go b/pkg/deployment/resources/inspector/endpoints_mod_v1.go index f35957bed..bc4c5dc11 100644 --- a/pkg/deployment/resources/inspector/endpoints_mod_v1.go +++ b/pkg/deployment/resources/inspector/endpoints_mod_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - endpointsv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + endpointsv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints/v1" ) func (p endpointsMod) V1() endpointsv1.ModInterface { diff --git a/pkg/deployment/resources/inspector/endpoints_v1.go b/pkg/deployment/resources/inspector/endpoints_v1.go index c7ae28e6a..dab59526e 100644 --- a/pkg/deployment/resources/inspector/endpoints_v1.go +++ b/pkg/deployment/resources/inspector/endpoints_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints/v1" core "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints/v1" ) func (p *endpointsInspector) V1() (ins.Inspector, error) { diff --git a/pkg/deployment/resources/inspector/gvk.go b/pkg/deployment/resources/inspector/gvk.go index 9f5bd1476..961d6db03 100644 --- a/pkg/deployment/resources/inspector/gvk.go +++ b/pkg/deployment/resources/inspector/gvk.go @@ -21,12 +21,13 @@ package inspector import ( - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" core "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/runtime/schema" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) func ExtractGVKFromObject(in interface{}) (schema.GroupVersionKind, bool) { diff --git a/pkg/deployment/resources/inspector/gvk_test.go b/pkg/deployment/resources/inspector/gvk_test.go index a17effc3f..5e6cd3290 100644 --- a/pkg/deployment/resources/inspector/gvk_test.go +++ b/pkg/deployment/resources/inspector/gvk_test.go @@ -24,13 +24,14 @@ import ( "reflect" "testing" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/runtime/schema" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) func Test_GVK(t *testing.T) { diff --git a/pkg/deployment/resources/inspector/inspector.go b/pkg/deployment/resources/inspector/inspector.go index 4c01e272f..23a63760d 100644 --- a/pkg/deployment/resources/inspector/inspector.go +++ b/pkg/deployment/resources/inspector/inspector.go @@ -26,7 +26,12 @@ import ( "sync" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/util" @@ -47,9 +52,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" ) const ( diff --git a/pkg/deployment/resources/inspector/inspector_test.go b/pkg/deployment/resources/inspector/inspector_test.go index f14384161..3cc898ef7 100644 --- a/pkg/deployment/resources/inspector/inspector_test.go +++ b/pkg/deployment/resources/inspector/inspector_test.go @@ -25,11 +25,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/refresh" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/stretchr/testify/require" ) type loaderTestDefinition struct { diff --git a/pkg/deployment/resources/inspector/nodes.go b/pkg/deployment/resources/inspector/nodes.go index 1e2953da7..e8f9775cc 100644 --- a/pkg/deployment/resources/inspector/nodes.go +++ b/pkg/deployment/resources/inspector/nodes.go @@ -24,11 +24,12 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/nodes_anonymous.go b/pkg/deployment/resources/inspector/nodes_anonymous.go index c67f970ee..e11a96cb2 100644 --- a/pkg/deployment/resources/inspector/nodes_anonymous.go +++ b/pkg/deployment/resources/inspector/nodes_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *nodesInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/nodes_v1.go b/pkg/deployment/resources/inspector/nodes_v1.go index c87dfba35..409a60b45 100644 --- a/pkg/deployment/resources/inspector/nodes_v1.go +++ b/pkg/deployment/resources/inspector/nodes_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/node/v1" core "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/node/v1" ) func (p *nodesInspector) V1() (ins.Inspector, error) { diff --git a/pkg/deployment/resources/inspector/owner.go b/pkg/deployment/resources/inspector/owner.go index 3f03f26a9..298af8bdf 100644 --- a/pkg/deployment/resources/inspector/owner.go +++ b/pkg/deployment/resources/inspector/owner.go @@ -23,10 +23,11 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (i *inspectorState) IsOwnerOf(ctx context.Context, owner inspector.Object, obj meta.Object) bool { diff --git a/pkg/deployment/resources/inspector/owner_test.go b/pkg/deployment/resources/inspector/owner_test.go index 3e91beda4..357eedb25 100644 --- a/pkg/deployment/resources/inspector/owner_test.go +++ b/pkg/deployment/resources/inspector/owner_test.go @@ -25,14 +25,15 @@ import ( "fmt" "testing" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/uuid" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" ) func Test_OwnerRef(t *testing.T) { diff --git a/pkg/deployment/resources/inspector/pods.go b/pkg/deployment/resources/inspector/pods.go index c2fcfc24a..e14d4a00c 100644 --- a/pkg/deployment/resources/inspector/pods.go +++ b/pkg/deployment/resources/inspector/pods.go @@ -24,11 +24,12 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/pods_anonymous.go b/pkg/deployment/resources/inspector/pods_anonymous.go index 72fd808ef..8636fb5c6 100644 --- a/pkg/deployment/resources/inspector/pods_anonymous.go +++ b/pkg/deployment/resources/inspector/pods_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *podsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/pods_mod_v1.go b/pkg/deployment/resources/inspector/pods_mod_v1.go index ee3d84341..8128ec97a 100644 --- a/pkg/deployment/resources/inspector/pods_mod_v1.go +++ b/pkg/deployment/resources/inspector/pods_mod_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" ) func (p podsMod) V1() podv1.ModInterface { diff --git a/pkg/deployment/resources/inspector/pods_v1.go b/pkg/deployment/resources/inspector/pods_v1.go index dcd3895b8..410ec7cd5 100644 --- a/pkg/deployment/resources/inspector/pods_v1.go +++ b/pkg/deployment/resources/inspector/pods_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" core "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" ) func (p *podsInspector) V1() ins.Inspector { diff --git a/pkg/deployment/resources/inspector/pvcs.go b/pkg/deployment/resources/inspector/pvcs.go index cd2fe48f7..5cdd2ad6c 100644 --- a/pkg/deployment/resources/inspector/pvcs.go +++ b/pkg/deployment/resources/inspector/pvcs.go @@ -24,11 +24,12 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/pvcs_anonymous.go b/pkg/deployment/resources/inspector/pvcs_anonymous.go index 6aa30cf85..540161914 100644 --- a/pkg/deployment/resources/inspector/pvcs_anonymous.go +++ b/pkg/deployment/resources/inspector/pvcs_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *persistentVolumeClaimsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/pvcs_mod_v1.go b/pkg/deployment/resources/inspector/pvcs_mod_v1.go index 33b13181a..1da699dee 100644 --- a/pkg/deployment/resources/inspector/pvcs_mod_v1.go +++ b/pkg/deployment/resources/inspector/pvcs_mod_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - persistentVolumeClaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + persistentVolumeClaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" ) func (p persistentVolumeClaimsMod) V1() persistentVolumeClaimv1.ModInterface { diff --git a/pkg/deployment/resources/inspector/pvcs_v1.go b/pkg/deployment/resources/inspector/pvcs_v1.go index 42f6d2b2a..7a2f73d35 100644 --- a/pkg/deployment/resources/inspector/pvcs_v1.go +++ b/pkg/deployment/resources/inspector/pvcs_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" core "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" ) func (p *persistentVolumeClaimsInspector) V1() ins.Inspector { diff --git a/pkg/deployment/resources/inspector/sa.go b/pkg/deployment/resources/inspector/sa.go index 325f47739..8b5245e91 100644 --- a/pkg/deployment/resources/inspector/sa.go +++ b/pkg/deployment/resources/inspector/sa.go @@ -24,11 +24,12 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/sa_anonymous.go b/pkg/deployment/resources/inspector/sa_anonymous.go index 6a2c741b9..ab5687104 100644 --- a/pkg/deployment/resources/inspector/sa_anonymous.go +++ b/pkg/deployment/resources/inspector/sa_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *serviceAccountsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/sa_mod_v1.go b/pkg/deployment/resources/inspector/sa_mod_v1.go index d7d58b4d0..ff134ca9c 100644 --- a/pkg/deployment/resources/inspector/sa_mod_v1.go +++ b/pkg/deployment/resources/inspector/sa_mod_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - serviceAccountv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + serviceAccountv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount/v1" ) func (p serviceAccountsMod) V1() serviceAccountv1.ModInterface { diff --git a/pkg/deployment/resources/inspector/sa_v1.go b/pkg/deployment/resources/inspector/sa_v1.go index 45add9e9c..976e2a067 100644 --- a/pkg/deployment/resources/inspector/sa_v1.go +++ b/pkg/deployment/resources/inspector/sa_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount/v1" core "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount/v1" ) func (p *serviceAccountsInspector) V1() ins.Inspector { diff --git a/pkg/deployment/resources/inspector/secrets.go b/pkg/deployment/resources/inspector/secrets.go index 08956d64b..5045afc25 100644 --- a/pkg/deployment/resources/inspector/secrets.go +++ b/pkg/deployment/resources/inspector/secrets.go @@ -24,11 +24,12 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/secrets_anonymous.go b/pkg/deployment/resources/inspector/secrets_anonymous.go index 7c710a213..bb5ccc5f5 100644 --- a/pkg/deployment/resources/inspector/secrets_anonymous.go +++ b/pkg/deployment/resources/inspector/secrets_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *secretsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/secrets_mod_v1.go b/pkg/deployment/resources/inspector/secrets_mod_v1.go index e153695ba..7bc9de74f 100644 --- a/pkg/deployment/resources/inspector/secrets_mod_v1.go +++ b/pkg/deployment/resources/inspector/secrets_mod_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" ) func (p secretsMod) V1() secretv1.ModInterface { diff --git a/pkg/deployment/resources/inspector/secrets_v1.go b/pkg/deployment/resources/inspector/secrets_v1.go index 7987ea9da..4e23290cd 100644 --- a/pkg/deployment/resources/inspector/secrets_v1.go +++ b/pkg/deployment/resources/inspector/secrets_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" core "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" ) func (p *secretsInspector) V1() ins.Inspector { diff --git a/pkg/deployment/resources/inspector/service_mod_v1.go b/pkg/deployment/resources/inspector/service_mod_v1.go index 5fca11ca1..27ea0383d 100644 --- a/pkg/deployment/resources/inspector/service_mod_v1.go +++ b/pkg/deployment/resources/inspector/service_mod_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - servicev1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + servicev1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service/v1" ) func (p servicesMod) V1() servicev1.ModInterface { diff --git a/pkg/deployment/resources/inspector/services.go b/pkg/deployment/resources/inspector/services.go index e89135b4d..5911a3882 100644 --- a/pkg/deployment/resources/inspector/services.go +++ b/pkg/deployment/resources/inspector/services.go @@ -24,11 +24,12 @@ import ( "context" "time" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/services_anonymous.go b/pkg/deployment/resources/inspector/services_anonymous.go index 6bf51103d..751eabf98 100644 --- a/pkg/deployment/resources/inspector/services_anonymous.go +++ b/pkg/deployment/resources/inspector/services_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *servicesInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/services_v1.go b/pkg/deployment/resources/inspector/services_v1.go index 3dd741a06..eff190f1e 100644 --- a/pkg/deployment/resources/inspector/services_v1.go +++ b/pkg/deployment/resources/inspector/services_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service/v1" core "k8s.io/api/core/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service/v1" ) func (p *servicesInspector) V1() ins.Inspector { diff --git a/pkg/deployment/resources/inspector/sm.go b/pkg/deployment/resources/inspector/sm.go index 53dfd3b90..15d02cebf 100644 --- a/pkg/deployment/resources/inspector/sm.go +++ b/pkg/deployment/resources/inspector/sm.go @@ -24,11 +24,12 @@ import ( "context" "time" + monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func init() { diff --git a/pkg/deployment/resources/inspector/sm_anonymous.go b/pkg/deployment/resources/inspector/sm_anonymous.go index cedd0a971..1e748da72 100644 --- a/pkg/deployment/resources/inspector/sm_anonymous.go +++ b/pkg/deployment/resources/inspector/sm_anonymous.go @@ -21,8 +21,9 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) func (p *serviceMonitorsInspector) Anonymous(gvk schema.GroupVersionKind) (anonymous.Interface, bool) { diff --git a/pkg/deployment/resources/inspector/sm_mod_v1.go b/pkg/deployment/resources/inspector/sm_mod_v1.go index 6e6c7786f..8b29d34bc 100644 --- a/pkg/deployment/resources/inspector/sm_mod_v1.go +++ b/pkg/deployment/resources/inspector/sm_mod_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - serviceMonitorv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor/v1" monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + serviceMonitorv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor/v1" ) func (p serviceMonitorsMod) V1() serviceMonitorv1.ModInterface { diff --git a/pkg/deployment/resources/inspector/sm_v1.go b/pkg/deployment/resources/inspector/sm_v1.go index c7f065071..de3160ac5 100644 --- a/pkg/deployment/resources/inspector/sm_v1.go +++ b/pkg/deployment/resources/inspector/sm_v1.go @@ -23,11 +23,12 @@ package inspector import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor/v1" monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" apiErrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + ins "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor/v1" ) func (p *serviceMonitorsInspector) V1() (ins.Inspector, error) { diff --git a/pkg/deployment/resources/internal_exporter.go b/pkg/deployment/resources/internal_exporter.go index 17b8bd223..1ca6b498a 100644 --- a/pkg/deployment/resources/internal_exporter.go +++ b/pkg/deployment/resources/internal_exporter.go @@ -22,13 +22,13 @@ import ( "os" "path/filepath" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/probes" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/probes" ) // ArangodbInternalExporterContainer creates metrics container based on internal exporter diff --git a/pkg/deployment/resources/labels.go b/pkg/deployment/resources/labels.go index 484744e39..d400c5a02 100644 --- a/pkg/deployment/resources/labels.go +++ b/pkg/deployment/resources/labels.go @@ -23,8 +23,6 @@ package resources import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" core "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" @@ -33,6 +31,7 @@ import ( "k8s.io/apimachinery/pkg/types" "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" ) diff --git a/pkg/deployment/resources/license.go b/pkg/deployment/resources/license.go index 082286d6a..2fc91aca1 100644 --- a/pkg/deployment/resources/license.go +++ b/pkg/deployment/resources/license.go @@ -21,10 +21,9 @@ package resources import ( + "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - - "github.com/arangodb/kube-arangodb/pkg/util/constants" ) // ValidateLicenseKeySecret checks if the licens key secret exists and is valid diff --git a/pkg/deployment/resources/logger.go b/pkg/deployment/resources/logger.go index ae70cea47..bbf808dc9 100644 --- a/pkg/deployment/resources/logger.go +++ b/pkg/deployment/resources/logger.go @@ -21,8 +21,9 @@ package resources import ( - "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/rs/zerolog" + + "github.com/arangodb/kube-arangodb/pkg/logging" ) var ( diff --git a/pkg/deployment/resources/member_cleanup.go b/pkg/deployment/resources/member_cleanup.go index 1d7de3c7f..de364d67a 100644 --- a/pkg/deployment/resources/member_cleanup.go +++ b/pkg/deployment/resources/member_cleanup.go @@ -24,15 +24,15 @@ import ( "context" "time" - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - driver "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" memberState "github.com/arangodb/kube-arangodb/pkg/deployment/member" "github.com/arangodb/kube-arangodb/pkg/metrics" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" arangomemberv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangomember/v1" ) diff --git a/pkg/deployment/resources/metrics.go b/pkg/deployment/resources/metrics.go index 4560d08b5..40f50d4a7 100644 --- a/pkg/deployment/resources/metrics.go +++ b/pkg/deployment/resources/metrics.go @@ -21,9 +21,8 @@ package resources import ( - "sync" - "fmt" + "sync" "github.com/arangodb/kube-arangodb/pkg/generated/metric_descriptions" "github.com/arangodb/kube-arangodb/pkg/util/metrics" diff --git a/pkg/deployment/resources/pdbs.go b/pkg/deployment/resources/pdbs.go index c732779e8..93a62e586 100644 --- a/pkg/deployment/resources/pdbs.go +++ b/pkg/deployment/resources/pdbs.go @@ -25,15 +25,14 @@ import ( "fmt" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - policyv1 "k8s.io/api/policy/v1" policyv1beta1 "k8s.io/api/policy/v1beta1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/resources/pod_cleanup.go b/pkg/deployment/resources/pod_cleanup.go index c01f07a2f..b68ab1d83 100644 --- a/pkg/deployment/resources/pod_cleanup.go +++ b/pkg/deployment/resources/pod_cleanup.go @@ -25,6 +25,7 @@ import ( "time" core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" @@ -33,7 +34,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index d77cb6741..ba2937cb8 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -31,33 +31,25 @@ import ( "sync" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/deployment/member" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" - - "github.com/arangodb/kube-arangodb/pkg/util" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/member" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" ) // createArangodArgsWithUpgrade creates command line arguments for an arangod server upgrade in the given group. diff --git a/pkg/deployment/resources/pod_creator_agent_args_test.go b/pkg/deployment/resources/pod_creator_agent_args_test.go index aa0d028a5..20e334971 100644 --- a/pkg/deployment/resources/pod_creator_agent_args_test.go +++ b/pkg/deployment/resources/pod_creator_agent_args_test.go @@ -21,25 +21,23 @@ package resources import ( + "context" "path/filepath" "testing" - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "context" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/arangodb/kube-arangodb/pkg/util/tests" - core "k8s.io/api/core/v1" ) func createClient(f kclient.FakeClientBuilder, apiObject *api.ArangoDeployment, group api.ServerGroup, statuses ...api.MemberStatus) kclient.FakeClientBuilder { diff --git a/pkg/deployment/resources/pod_creator_arangod.go b/pkg/deployment/resources/pod_creator_arangod.go index c8cacacde..982d46a6a 100644 --- a/pkg/deployment/resources/pod_creator_arangod.go +++ b/pkg/deployment/resources/pod_creator_arangod.go @@ -26,24 +26,18 @@ import ( "math" "os" - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - "github.com/arangodb/kube-arangodb/pkg/deployment/topology" - - "github.com/arangodb/kube-arangodb/pkg/util/collection" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - - "github.com/arangodb/kube-arangodb/pkg/util" - - "github.com/arangodb/kube-arangodb/pkg/util/constants" + core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/deployment/topology" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/collection" + "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" ) const ( diff --git a/pkg/deployment/resources/pod_creator_coordinator_args_test.go b/pkg/deployment/resources/pod_creator_coordinator_args_test.go index d337eebdb..73275a491 100644 --- a/pkg/deployment/resources/pod_creator_coordinator_args_test.go +++ b/pkg/deployment/resources/pod_creator_coordinator_args_test.go @@ -24,15 +24,13 @@ import ( "path/filepath" "testing" - "github.com/stretchr/testify/require" - - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/kclient" diff --git a/pkg/deployment/resources/pod_creator_dbserver_args_test.go b/pkg/deployment/resources/pod_creator_dbserver_args_test.go index bc48fe8a3..26de96aa9 100644 --- a/pkg/deployment/resources/pod_creator_dbserver_args_test.go +++ b/pkg/deployment/resources/pod_creator_dbserver_args_test.go @@ -24,15 +24,13 @@ import ( "path/filepath" "testing" - "github.com/stretchr/testify/require" - - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/kclient" diff --git a/pkg/deployment/resources/pod_creator_single_args_test.go b/pkg/deployment/resources/pod_creator_single_args_test.go index df10f138b..ef9b15c58 100644 --- a/pkg/deployment/resources/pod_creator_single_args_test.go +++ b/pkg/deployment/resources/pod_creator_single_args_test.go @@ -24,19 +24,17 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/arangodb/kube-arangodb/pkg/util/tests" - "github.com/stretchr/testify/assert" ) // TestCreateArangodArgsSingle tests createArangodArgs for single server. diff --git a/pkg/deployment/resources/pod_creator_sync.go b/pkg/deployment/resources/pod_creator_sync.go index 131b55f32..ab3489691 100644 --- a/pkg/deployment/resources/pod_creator_sync.go +++ b/pkg/deployment/resources/pod_creator_sync.go @@ -24,6 +24,9 @@ import ( "context" "math" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/features" @@ -34,9 +37,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( diff --git a/pkg/deployment/resources/pod_finalizers.go b/pkg/deployment/resources/pod_finalizers.go index fcd194fd7..0eda21fd0 100644 --- a/pkg/deployment/resources/pod_finalizers.go +++ b/pkg/deployment/resources/pod_finalizers.go @@ -24,16 +24,14 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/resources/pod_termination.go b/pkg/deployment/resources/pod_termination.go index 074332a94..4a9992be2 100644 --- a/pkg/deployment/resources/pod_termination.go +++ b/pkg/deployment/resources/pod_termination.go @@ -23,18 +23,17 @@ package resources import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - + core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" driver "github.com/arangodb/go-driver" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/deployment/agency" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - core "k8s.io/api/core/v1" ) // prepareAgencyPodTermination checks if the given agency pod is allowed to terminate diff --git a/pkg/deployment/resources/pvc_finalizers.go b/pkg/deployment/resources/pvc_finalizers.go index b02582052..326a38ccc 100644 --- a/pkg/deployment/resources/pvc_finalizers.go +++ b/pkg/deployment/resources/pvc_finalizers.go @@ -24,16 +24,14 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/deployment/resources/pvcs.go b/pkg/deployment/resources/pvcs.go index 8d460f165..98c230736 100644 --- a/pkg/deployment/resources/pvcs.go +++ b/pkg/deployment/resources/pvcs.go @@ -23,11 +23,10 @@ package resources import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" ) diff --git a/pkg/deployment/resources/secret_hashes.go b/pkg/deployment/resources/secret_hashes.go index 75248361f..caccfd9d8 100644 --- a/pkg/deployment/resources/secret_hashes.go +++ b/pkg/deployment/resources/secret_hashes.go @@ -28,17 +28,14 @@ import ( "sort" "strings" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - core "k8s.io/api/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" ) // ValidateSecretHashes checks the hash of used secrets diff --git a/pkg/deployment/resources/secrets.go b/pkg/deployment/resources/secrets.go index 109f02e09..00130da1d 100644 --- a/pkg/deployment/resources/secrets.go +++ b/pkg/deployment/resources/secrets.go @@ -28,35 +28,27 @@ import ( "fmt" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + jg "github.com/golang-jwt/jwt" + core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/equality" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/json" - "github.com/arangodb/kube-arangodb/pkg/util" - - operatorErrors "github.com/arangodb/kube-arangodb/pkg/util/errors" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" + "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/metrics" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" - jg "github.com/golang-jwt/jwt" - "k8s.io/apimachinery/pkg/api/equality" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/tls" ) var ( @@ -223,7 +215,7 @@ func (r *Resources) ensureTokenSecretFolder(ctx context.Context, cachedStatus in return err } - return operatorErrors.Reconcile() + return errors.Reconcile() } if _, ok := f.Data[pod.ActiveJWTKey]; !ok { @@ -335,7 +327,7 @@ func (r *Resources) createSecretWithMod(ctx context.Context, secrets secretv1.Mo return errors.WithStack(err) } - return operatorErrors.Reconcile() + return errors.Reconcile() } func (r *Resources) createSecretWithKey(ctx context.Context, secrets secretv1.ModInterface, secretName, keyName string, value []byte) error { @@ -362,7 +354,7 @@ func (r *Resources) createTokenSecret(ctx context.Context, secrets secretv1.ModI return errors.WithStack(err) } - return operatorErrors.Reconcile() + return errors.Reconcile() } func (r *Resources) ensureEncryptionKeyfolderSecret(ctx context.Context, cachedStatus inspectorInterface.Inspector, secrets secretv1.ModInterface, keyfileSecretName, secretName string) error { @@ -422,7 +414,7 @@ func AppendKeyfileToKeyfolder(ctx context.Context, cachedStatus inspectorInterfa return errors.WithStack(err) } - return operatorErrors.Reconcile() + return errors.Reconcile() } return nil @@ -458,7 +450,7 @@ func (r *Resources) ensureExporterTokenSecret(ctx context.Context, cachedStatus } } - return operatorErrors.Reconcile() + return errors.Reconcile() } return nil } @@ -519,7 +511,7 @@ func (r *Resources) ensureTLSCACertificateSecret(ctx context.Context, cachedStat return errors.WithStack(err) } - return operatorErrors.Reconcile() + return errors.Reconcile() } return nil } @@ -543,7 +535,7 @@ func (r *Resources) ensureClientAuthCACertificateSecret(ctx context.Context, cac return errors.WithStack(err) } - return operatorErrors.Reconcile() + return errors.Reconcile() } return nil } diff --git a/pkg/deployment/resources/servicemonitor.go b/pkg/deployment/resources/servicemonitor.go index b08556571..8e5c263f8 100644 --- a/pkg/deployment/resources/servicemonitor.go +++ b/pkg/deployment/resources/servicemonitor.go @@ -23,21 +23,20 @@ package resources import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" + coreosv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + "k8s.io/apimachinery/pkg/api/equality" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" "github.com/arangodb/kube-arangodb/pkg/apis/deployment" deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/apimachinery/pkg/api/equality" - apiErrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime/schema" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - coreosv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func LabelsForExporterServiceMonitor(name string, obj deploymentApi.DeploymentSpec) map[string]string { diff --git a/pkg/deployment/resources/services.go b/pkg/deployment/resources/services.go index 425f33eef..79c4d113e 100644 --- a/pkg/deployment/resources/services.go +++ b/pkg/deployment/resources/services.go @@ -25,22 +25,19 @@ import ( "strings" "time" - "github.com/arangodb/kube-arangodb/pkg/deployment/features" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/util/intstr" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/equality" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/deployment/features" "github.com/arangodb/kube-arangodb/pkg/metrics" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" + inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" servicev1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service/v1" ) diff --git a/pkg/deployment/rotation/arangod.go b/pkg/deployment/rotation/arangod.go index 5fd8aafe7..2e7dd8b8e 100644 --- a/pkg/deployment/rotation/arangod.go +++ b/pkg/deployment/rotation/arangod.go @@ -23,10 +23,10 @@ package rotation import ( "reflect" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" - - core "k8s.io/api/core/v1" ) func podCompare(_ api.DeploymentSpec, _ api.ServerGroup, spec, status *core.PodSpec) compareFunc { diff --git a/pkg/deployment/rotation/arangod_containers.go b/pkg/deployment/rotation/arangod_containers.go index 50e56e974..262950595 100644 --- a/pkg/deployment/rotation/arangod_containers.go +++ b/pkg/deployment/rotation/arangod_containers.go @@ -23,13 +23,12 @@ package rotation import ( "strings" - "github.com/arangodb/kube-arangodb/pkg/deployment/topology" - + core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/topology" "github.com/arangodb/kube-arangodb/pkg/util" - core "k8s.io/api/core/v1" ) const ( diff --git a/pkg/deployment/rotation/arangod_test.go b/pkg/deployment/rotation/arangod_test.go index 89534caf0..59ffc1052 100644 --- a/pkg/deployment/rotation/arangod_test.go +++ b/pkg/deployment/rotation/arangod_test.go @@ -23,11 +23,10 @@ package rotation import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" + core "k8s.io/api/core/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/topology" - - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util" ) func Test_ArangoD_SchedulerName(t *testing.T) { diff --git a/pkg/deployment/rotation/check.go b/pkg/deployment/rotation/check.go index 85895ea81..6458814cd 100644 --- a/pkg/deployment/rotation/check.go +++ b/pkg/deployment/rotation/check.go @@ -23,12 +23,13 @@ package rotation import ( "time" + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/acs/sutil" "github.com/arangodb/kube-arangodb/pkg/handlers/utils" "github.com/arangodb/kube-arangodb/pkg/util/constants" - core "k8s.io/api/core/v1" ) type Mode int diff --git a/pkg/deployment/rotation/compare.go b/pkg/deployment/rotation/compare.go index 35b59f807..e2346cf33 100644 --- a/pkg/deployment/rotation/compare.go +++ b/pkg/deployment/rotation/compare.go @@ -23,11 +23,12 @@ package rotation import ( "encoding/json" + "github.com/rs/zerolog/log" + core "k8s.io/api/core/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/actions" "github.com/arangodb/kube-arangodb/pkg/deployment/resources" - "github.com/rs/zerolog/log" - core "k8s.io/api/core/v1" ) type compareFuncGen func(deploymentSpec api.DeploymentSpec, group api.ServerGroup, spec, status *core.PodSpec) compareFunc diff --git a/pkg/deployment/rotation/utils_test.go b/pkg/deployment/rotation/utils_test.go index d8c6b1574..5aadb98ea 100644 --- a/pkg/deployment/rotation/utils_test.go +++ b/pkg/deployment/rotation/utils_test.go @@ -23,10 +23,11 @@ package rotation import ( "testing" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/deployment/resources" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources" ) type TestCase struct { diff --git a/pkg/deployment/topology/topology.community.go b/pkg/deployment/topology/topology.community.go index c4a6e8b81..f7f6f9ec6 100644 --- a/pkg/deployment/topology/topology.community.go +++ b/pkg/deployment/topology/topology.community.go @@ -22,8 +22,9 @@ package topology import ( - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) func GetTopologyAffinityRules(name string, status api.DeploymentStatus, group api.ServerGroup, member api.MemberStatus) core.Affinity { diff --git a/pkg/exporter/monitor.go b/pkg/exporter/monitor.go index 39fbdac00..da38666b0 100644 --- a/pkg/exporter/monitor.go +++ b/pkg/exporter/monitor.go @@ -34,6 +34,7 @@ import ( "time" "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/logging" ) diff --git a/pkg/handlers/backup/arango_client.go b/pkg/handlers/backup/arango_client.go index 46e051b79..5fc4c1951 100644 --- a/pkg/handlers/backup/arango_client.go +++ b/pkg/handlers/backup/arango_client.go @@ -23,11 +23,11 @@ package backup import ( "net/http" - "github.com/arangodb/kube-arangodb/pkg/handlers/utils" - "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/handlers/utils" ) var ( diff --git a/pkg/handlers/backup/arango_client_impl.go b/pkg/handlers/backup/arango_client_impl.go index d3d5417ed..7692138dc 100644 --- a/pkg/handlers/backup/arango_client_impl.go +++ b/pkg/handlers/backup/arango_client_impl.go @@ -26,16 +26,16 @@ import ( "fmt" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" + "k8s.io/client-go/kubernetes" "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/arangod" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "k8s.io/client-go/kubernetes" ) type arangoClientBackupImpl struct { diff --git a/pkg/handlers/backup/arango_client_mock_test.go b/pkg/handlers/backup/arango_client_mock_test.go index 0ab457e58..052775d24 100644 --- a/pkg/handlers/backup/arango_client_mock_test.go +++ b/pkg/handlers/backup/arango_client_mock_test.go @@ -25,12 +25,13 @@ import ( "sync" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/uuid" "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "k8s.io/apimachinery/pkg/util/uuid" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/handlers/backup/arango_client_test.go b/pkg/handlers/backup/arango_client_test.go index 85ad64a85..281759c8a 100644 --- a/pkg/handlers/backup/arango_client_test.go +++ b/pkg/handlers/backup/arango_client_test.go @@ -25,11 +25,11 @@ import ( "math/rand" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/stretchr/testify/require" "github.com/arangodb/go-driver" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func Test_Errors_Temporary(t *testing.T) { diff --git a/pkg/handlers/backup/backup_suite_test.go b/pkg/handlers/backup/backup_suite_test.go index 95daf6d19..860244aa6 100644 --- a/pkg/handlers/backup/backup_suite_test.go +++ b/pkg/handlers/backup/backup_suite_test.go @@ -25,23 +25,22 @@ import ( "fmt" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/apis/backup" - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - - "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "k8s.io/client-go/kubernetes/fake" - - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" - "github.com/arangodb/kube-arangodb/pkg/handlers/backup/state" "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/go-driver" + + "github.com/arangodb/kube-arangodb/pkg/apis/backup" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" + database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + "github.com/arangodb/kube-arangodb/pkg/handlers/backup/state" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/handlers/backup/errors.go b/pkg/handlers/backup/errors.go index 5824528c6..5acf7a924 100644 --- a/pkg/handlers/backup/errors.go +++ b/pkg/handlers/backup/errors.go @@ -23,10 +23,10 @@ package backup import ( "strings" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/handlers/utils" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func newTemporaryError(err error) error { diff --git a/pkg/handlers/backup/finalizer.go b/pkg/handlers/backup/finalizer.go index 6359960a0..33855dc07 100644 --- a/pkg/handlers/backup/finalizer.go +++ b/pkg/handlers/backup/finalizer.go @@ -23,12 +23,14 @@ package backup import ( "context" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/arangodb/kube-arangodb/pkg/handlers/utils" "github.com/arangodb/kube-arangodb/pkg/util/errors" - apiErrors "k8s.io/apimachinery/pkg/api/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func (h *handler) finalize(backup *backupApi.ArangoBackup) error { diff --git a/pkg/handlers/backup/finalizer_test.go b/pkg/handlers/backup/finalizer_test.go index 4602ad3ae..00ecf9bdb 100644 --- a/pkg/handlers/backup/finalizer_test.go +++ b/pkg/handlers/backup/finalizer_test.go @@ -24,10 +24,11 @@ import ( "testing" "time" - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_Finalizer_PassThru(t *testing.T) { diff --git a/pkg/handlers/backup/flow_test.go b/pkg/handlers/backup/flow_test.go index 6b2f9302a..418e5e14b 100644 --- a/pkg/handlers/backup/flow_test.go +++ b/pkg/handlers/backup/flow_test.go @@ -23,9 +23,10 @@ package backup import ( "testing" + "github.com/stretchr/testify/require" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" ) func Test_Flow_SuccessHappyPath(t *testing.T) { diff --git a/pkg/handlers/backup/handler.go b/pkg/handlers/backup/handler.go index ef09be954..045337478 100644 --- a/pkg/handlers/backup/handler.go +++ b/pkg/handlers/backup/handler.go @@ -26,30 +26,25 @@ import ( "sync" "time" - operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/apis/backup" - "github.com/arangodb/kube-arangodb/pkg/util" - - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/handlers/utils" + "github.com/rs/zerolog/log" + apiErrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" - - "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "k8s.io/client-go/kubernetes" - apiErrors "k8s.io/apimachinery/pkg/api/errors" - - "github.com/rs/zerolog/log" + "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/apis/backup" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + "github.com/arangodb/kube-arangodb/pkg/handlers/utils" "github.com/arangodb/kube-arangodb/pkg/logging" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) var logger = logging.Global().RegisterAndGetLogger("backup-operator", logging.Info) diff --git a/pkg/handlers/backup/handler_test.go b/pkg/handlers/backup/handler_test.go index 69560bb67..780a1787c 100644 --- a/pkg/handlers/backup/handler_test.go +++ b/pkg/handlers/backup/handler_test.go @@ -23,10 +23,10 @@ package backup import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_ObjectNotFound(t *testing.T) { diff --git a/pkg/handlers/backup/lifecycle.go b/pkg/handlers/backup/lifecycle.go index fab358213..240133188 100644 --- a/pkg/handlers/backup/lifecycle.go +++ b/pkg/handlers/backup/lifecycle.go @@ -24,11 +24,11 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/apis/backup" - - operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" "github.com/rs/zerolog/log" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/backup" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" ) var _ operator.LifecyclePreStart = &handler{} diff --git a/pkg/handlers/backup/register.go b/pkg/handlers/backup/register.go index dd5d52105..1445d59bd 100644 --- a/pkg/handlers/backup/register.go +++ b/pkg/handlers/backup/register.go @@ -21,13 +21,14 @@ package backup import ( + "k8s.io/client-go/kubernetes" + "github.com/arangodb/kube-arangodb/pkg/apis/backup" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - "k8s.io/client-go/kubernetes" ) func newEventInstance(recorder event.Recorder) event.RecorderInstance { diff --git a/pkg/handlers/backup/state_create.go b/pkg/handlers/backup/state_create.go index e37ed35ec..709b275c4 100644 --- a/pkg/handlers/backup/state_create.go +++ b/pkg/handlers/backup/state_create.go @@ -22,6 +22,7 @@ package backup import ( "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" ) diff --git a/pkg/handlers/backup/state_create_test.go b/pkg/handlers/backup/state_create_test.go index fae7536d1..d7108bec3 100644 --- a/pkg/handlers/backup/state_create_test.go +++ b/pkg/handlers/backup/state_create_test.go @@ -23,13 +23,13 @@ package backup import ( "testing" - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/stretchr/testify/require" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/go-driver" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" ) func Test_State_Create_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_deleted.go b/pkg/handlers/backup/state_deleted.go index 0a266a675..c9f9cb46a 100644 --- a/pkg/handlers/backup/state_deleted.go +++ b/pkg/handlers/backup/state_deleted.go @@ -22,6 +22,7 @@ package backup import ( "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" ) diff --git a/pkg/handlers/backup/state_deleted_test.go b/pkg/handlers/backup/state_deleted_test.go index 2c3f97f17..2366bb887 100644 --- a/pkg/handlers/backup/state_deleted_test.go +++ b/pkg/handlers/backup/state_deleted_test.go @@ -23,10 +23,10 @@ package backup import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/stretchr/testify/require" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_Deleted(t *testing.T) { diff --git a/pkg/handlers/backup/state_download_test.go b/pkg/handlers/backup/state_download_test.go index cd741183c..d0f954e9d 100644 --- a/pkg/handlers/backup/state_download_test.go +++ b/pkg/handlers/backup/state_download_test.go @@ -23,9 +23,10 @@ package backup import ( "testing" + "github.com/stretchr/testify/require" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" ) func Test_State_Download_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_downloaderror_test.go b/pkg/handlers/backup/state_downloaderror_test.go index 800747287..d4b92e643 100644 --- a/pkg/handlers/backup/state_downloaderror_test.go +++ b/pkg/handlers/backup/state_downloaderror_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/stretchr/testify/require" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_DownloadError_Reschedule(t *testing.T) { diff --git a/pkg/handlers/backup/state_downloading.go b/pkg/handlers/backup/state_downloading.go index 73bb5e5d8..4f9018ffc 100644 --- a/pkg/handlers/backup/state_downloading.go +++ b/pkg/handlers/backup/state_downloading.go @@ -23,10 +23,10 @@ package backup import ( "fmt" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + "github.com/arangodb/kube-arangodb/pkg/util" ) func stateDownloadingHandler(h *handler, backup *backupApi.ArangoBackup) (*backupApi.ArangoBackupStatus, error) { diff --git a/pkg/handlers/backup/state_downloading_test.go b/pkg/handlers/backup/state_downloading_test.go index 215ab8de8..264b63f1a 100644 --- a/pkg/handlers/backup/state_downloading_test.go +++ b/pkg/handlers/backup/state_downloading_test.go @@ -24,11 +24,12 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/arangodb/go-driver" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" ) func Test_State_Downloading_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_failed_test.go b/pkg/handlers/backup/state_failed_test.go index c8540ac81..a40348811 100644 --- a/pkg/handlers/backup/state_failed_test.go +++ b/pkg/handlers/backup/state_failed_test.go @@ -23,10 +23,10 @@ package backup import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/stretchr/testify/require" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_Failed(t *testing.T) { diff --git a/pkg/handlers/backup/state_none_test.go b/pkg/handlers/backup/state_none_test.go index fb6b32ca8..0ae3974ab 100644 --- a/pkg/handlers/backup/state_none_test.go +++ b/pkg/handlers/backup/state_none_test.go @@ -23,9 +23,10 @@ package backup import ( "testing" + "github.com/stretchr/testify/require" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" ) func Test_State_None_Success(t *testing.T) { diff --git a/pkg/handlers/backup/state_pending_test.go b/pkg/handlers/backup/state_pending_test.go index f8ef78333..b41dee7fd 100644 --- a/pkg/handlers/backup/state_pending_test.go +++ b/pkg/handlers/backup/state_pending_test.go @@ -25,14 +25,12 @@ import ( "sync" "testing" - deploymentType "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - + "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/uuid" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + deploymentType "github.com/arangodb/kube-arangodb/pkg/apis/deployment" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_Pending_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_ready.go b/pkg/handlers/backup/state_ready.go index 8c7ad2350..86e7804c4 100644 --- a/pkg/handlers/backup/state_ready.go +++ b/pkg/handlers/backup/state_ready.go @@ -22,6 +22,7 @@ package backup import ( "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/arangodb/kube-arangodb/pkg/util/globals" ) diff --git a/pkg/handlers/backup/state_ready_test.go b/pkg/handlers/backup/state_ready_test.go index 2d4d49d1a..28e2be3c7 100644 --- a/pkg/handlers/backup/state_ready_test.go +++ b/pkg/handlers/backup/state_ready_test.go @@ -24,16 +24,15 @@ import ( "sync" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/uuid" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/go-driver" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) func Test_State_Ready_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_scheduled_test.go b/pkg/handlers/backup/state_scheduled_test.go index 17e28f003..b513a46de 100644 --- a/pkg/handlers/backup/state_scheduled_test.go +++ b/pkg/handlers/backup/state_scheduled_test.go @@ -23,10 +23,10 @@ package backup import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/stretchr/testify/require" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_Scheduled_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_unavailable.go b/pkg/handlers/backup/state_unavailable.go index 265e4a7ed..3e6295beb 100644 --- a/pkg/handlers/backup/state_unavailable.go +++ b/pkg/handlers/backup/state_unavailable.go @@ -22,6 +22,7 @@ package backup import ( "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" ) diff --git a/pkg/handlers/backup/state_unavailable_test.go b/pkg/handlers/backup/state_unavailable_test.go index c639c4a33..62c66ca7b 100644 --- a/pkg/handlers/backup/state_unavailable_test.go +++ b/pkg/handlers/backup/state_unavailable_test.go @@ -23,11 +23,12 @@ package backup import ( "testing" - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" "github.com/stretchr/testify/require" + "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_Unavailable_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_upload.go b/pkg/handlers/backup/state_upload.go index 7a4f87ef2..0e6201424 100644 --- a/pkg/handlers/backup/state_upload.go +++ b/pkg/handlers/backup/state_upload.go @@ -22,6 +22,7 @@ package backup import ( "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" ) diff --git a/pkg/handlers/backup/state_upload_test.go b/pkg/handlers/backup/state_upload_test.go index c76db7b74..afcc11f02 100644 --- a/pkg/handlers/backup/state_upload_test.go +++ b/pkg/handlers/backup/state_upload_test.go @@ -23,12 +23,12 @@ package backup import ( "testing" + "github.com/stretchr/testify/require" + "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_Upload_Common(t *testing.T) { diff --git a/pkg/handlers/backup/state_uploaderror_test.go b/pkg/handlers/backup/state_uploaderror_test.go index 1ecefd643..5c072aab6 100644 --- a/pkg/handlers/backup/state_uploaderror_test.go +++ b/pkg/handlers/backup/state_uploaderror_test.go @@ -24,14 +24,12 @@ import ( "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/util" - - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - + "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util" ) func Test_State_UploadError_Reschedule(t *testing.T) { diff --git a/pkg/handlers/backup/state_uploading.go b/pkg/handlers/backup/state_uploading.go index 4813641fe..e116cf311 100644 --- a/pkg/handlers/backup/state_uploading.go +++ b/pkg/handlers/backup/state_uploading.go @@ -23,10 +23,10 @@ package backup import ( "fmt" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + "github.com/arangodb/kube-arangodb/pkg/util" ) func stateUploadingHandler(h *handler, backup *backupApi.ArangoBackup) (*backupApi.ArangoBackupStatus, error) { diff --git a/pkg/handlers/backup/state_uploading_test.go b/pkg/handlers/backup/state_uploading_test.go index 16de561da..a0d4d929d 100644 --- a/pkg/handlers/backup/state_uploading_test.go +++ b/pkg/handlers/backup/state_uploading_test.go @@ -24,12 +24,12 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_State_Uploading_Common(t *testing.T) { diff --git a/pkg/handlers/backup/status.go b/pkg/handlers/backup/status.go index 976b243f3..75868a260 100644 --- a/pkg/handlers/backup/status.go +++ b/pkg/handlers/backup/status.go @@ -24,13 +24,14 @@ import ( "fmt" "sort" - shared "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/go-driver" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + shared "github.com/arangodb/kube-arangodb/pkg/apis/shared/v1" "github.com/arangodb/kube-arangodb/pkg/handlers/backup/state" "github.com/arangodb/kube-arangodb/pkg/util" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) type updateStatusFunc func(status *backupApi.ArangoBackupStatus) diff --git a/pkg/handlers/backup/util.go b/pkg/handlers/backup/util.go index 3306ea78a..4abcda75a 100644 --- a/pkg/handlers/backup/util.go +++ b/pkg/handlers/backup/util.go @@ -23,11 +23,10 @@ package backup import ( "context" - clientBackup "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/backup/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + clientBackup "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/backup/v1" "github.com/arangodb/kube-arangodb/pkg/handlers/backup/state" ) diff --git a/pkg/handlers/job/handler.go b/pkg/handlers/job/handler.go index fc4106d62..56e1ff10e 100644 --- a/pkg/handlers/job/handler.go +++ b/pkg/handlers/job/handler.go @@ -26,22 +26,21 @@ import ( "os" "reflect" - operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - - "github.com/arangodb/kube-arangodb/pkg/apis/apps" - appsApi "github.com/arangodb/kube-arangodb/pkg/apis/apps/v1" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - "github.com/arangodb/kube-arangodb/pkg/apis/shared" batchv1 "k8s.io/api/batch/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" + + "github.com/arangodb/kube-arangodb/pkg/apis/apps" + appsApi "github.com/arangodb/kube-arangodb/pkg/apis/apps/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) const ( diff --git a/pkg/handlers/job/handler_scheduler_test.go b/pkg/handlers/job/handler_scheduler_test.go index f5f8f2181..fa26116c1 100644 --- a/pkg/handlers/job/handler_scheduler_test.go +++ b/pkg/handlers/job/handler_scheduler_test.go @@ -23,11 +23,11 @@ package job import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/stretchr/testify/require" batchv1 "k8s.io/api/batch/v1" "k8s.io/apimachinery/pkg/util/uuid" - "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_Job_Create(t *testing.T) { diff --git a/pkg/handlers/job/handler_test.go b/pkg/handlers/job/handler_test.go index 70a6847e5..42ccd3894 100644 --- a/pkg/handlers/job/handler_test.go +++ b/pkg/handlers/job/handler_test.go @@ -23,10 +23,10 @@ package job import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_ObjectNotFound(t *testing.T) { diff --git a/pkg/handlers/job/job_suite_test.go b/pkg/handlers/job/job_suite_test.go index 2c1d8b415..0aa5b7830 100644 --- a/pkg/handlers/job/job_suite_test.go +++ b/pkg/handlers/job/job_suite_test.go @@ -24,6 +24,13 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + batchv1 "k8s.io/api/batch/v1" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/uuid" + "k8s.io/client-go/kubernetes/fake" + "github.com/arangodb/kube-arangodb/pkg/apis/apps" appsApi "github.com/arangodb/kube-arangodb/pkg/apis/apps/v1" "github.com/arangodb/kube-arangodb/pkg/apis/deployment" @@ -32,13 +39,6 @@ import ( operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - - "github.com/stretchr/testify/require" - batchv1 "k8s.io/api/batch/v1" - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/uuid" - "k8s.io/client-go/kubernetes/fake" ) func newFakeHandler() *handler { diff --git a/pkg/handlers/job/lifecycle.go b/pkg/handlers/job/lifecycle.go index b1b9258c5..7d8670410 100644 --- a/pkg/handlers/job/lifecycle.go +++ b/pkg/handlers/job/lifecycle.go @@ -24,11 +24,11 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/apis/apps" - operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" - "github.com/rs/zerolog/log" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/apps" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" ) var _ operator.LifecyclePreStart = &handler{} diff --git a/pkg/handlers/job/register.go b/pkg/handlers/job/register.go index cfeba783a..e3157651f 100644 --- a/pkg/handlers/job/register.go +++ b/pkg/handlers/job/register.go @@ -21,14 +21,14 @@ package job import ( + "k8s.io/client-go/kubernetes" + "github.com/arangodb/kube-arangodb/pkg/apis/apps" appsApi "github.com/arangodb/kube-arangodb/pkg/apis/apps/v1" arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - - "k8s.io/client-go/kubernetes" ) func newEventInstance(eventRecorder event.Recorder) event.RecorderInstance { diff --git a/pkg/handlers/policy/handler.go b/pkg/handlers/policy/handler.go index 6ca5e6682..80b139258 100644 --- a/pkg/handlers/policy/handler.go +++ b/pkg/handlers/policy/handler.go @@ -26,19 +26,16 @@ import ( "reflect" "time" - "github.com/arangodb/kube-arangodb/pkg/apis/backup" - operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" - - "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - - "k8s.io/client-go/kubernetes" - - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" "github.com/robfig/cron" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + + "github.com/arangodb/kube-arangodb/pkg/apis/backup" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) const ( diff --git a/pkg/handlers/policy/handler_scheduler_test.go b/pkg/handlers/policy/handler_scheduler_test.go index b1bbebeb4..098770f38 100644 --- a/pkg/handlers/policy/handler_scheduler_test.go +++ b/pkg/handlers/policy/handler_scheduler_test.go @@ -24,12 +24,12 @@ import ( "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" + + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_Scheduler_Schedule(t *testing.T) { diff --git a/pkg/handlers/policy/handler_suite_test.go b/pkg/handlers/policy/handler_suite_test.go index 9509f6851..fbf2e0423 100644 --- a/pkg/handlers/policy/handler_suite_test.go +++ b/pkg/handlers/policy/handler_suite_test.go @@ -25,20 +25,18 @@ import ( "fmt" "testing" - "github.com/arangodb/kube-arangodb/pkg/apis/backup" - "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - - "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - - "k8s.io/client-go/kubernetes/fake" - - backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" - database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" + "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/apis/backup" + backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" + database "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + fakeClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/fake" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func newFakeHandler() *handler { diff --git a/pkg/handlers/policy/handler_test.go b/pkg/handlers/policy/handler_test.go index 9f031171c..c52b7f888 100644 --- a/pkg/handlers/policy/handler_test.go +++ b/pkg/handlers/policy/handler_test.go @@ -23,10 +23,10 @@ package policy import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" apiErrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_ObjectNotFound(t *testing.T) { diff --git a/pkg/handlers/policy/lifecycle.go b/pkg/handlers/policy/lifecycle.go index f91c3cf4e..d334b4360 100644 --- a/pkg/handlers/policy/lifecycle.go +++ b/pkg/handlers/policy/lifecycle.go @@ -24,11 +24,11 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/apis/backup" - - operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" "github.com/rs/zerolog/log" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/backup" + operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" ) var _ operator.LifecyclePreStart = &handler{} diff --git a/pkg/handlers/policy/register.go b/pkg/handlers/policy/register.go index c783e057f..918b61251 100644 --- a/pkg/handlers/policy/register.go +++ b/pkg/handlers/policy/register.go @@ -21,13 +21,14 @@ package policy import ( + "k8s.io/client-go/kubernetes" + "github.com/arangodb/kube-arangodb/pkg/apis/backup" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" arangoClientSet "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" arangoInformer "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions" operator "github.com/arangodb/kube-arangodb/pkg/operatorV2" "github.com/arangodb/kube-arangodb/pkg/operatorV2/event" - "k8s.io/client-go/kubernetes" ) func newEventInstance(eventRecorder event.Recorder) event.RecorderInstance { diff --git a/pkg/operator/operator_deployment.go b/pkg/operator/operator_deployment.go index 653f06e72..dde66fcc5 100644 --- a/pkg/operator/operator_deployment.go +++ b/pkg/operator/operator_deployment.go @@ -21,15 +21,14 @@ package operator import ( - deploymentType "github.com/arangodb/kube-arangodb/pkg/apis/deployment" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - kwatch "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" + deploymentType "github.com/arangodb/kube-arangodb/pkg/apis/deployment" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment" "github.com/arangodb/kube-arangodb/pkg/metrics" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/operator/operator_deployment_relication.go b/pkg/operator/operator_deployment_relication.go index 35b870eaf..f4df2cff6 100644 --- a/pkg/operator/operator_deployment_relication.go +++ b/pkg/operator/operator_deployment_relication.go @@ -21,15 +21,14 @@ package operator import ( - replication2 "github.com/arangodb/kube-arangodb/pkg/apis/replication" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - kwatch "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" + replication2 "github.com/arangodb/kube-arangodb/pkg/apis/replication" api "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" "github.com/arangodb/kube-arangodb/pkg/metrics" "github.com/arangodb/kube-arangodb/pkg/replication" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/operator/operator_leader.go b/pkg/operator/operator_leader.go index 5f8f6da97..d389b674d 100644 --- a/pkg/operator/operator_leader.go +++ b/pkg/operator/operator_leader.go @@ -26,8 +26,6 @@ import ( "os" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -36,6 +34,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/probe" "github.com/arangodb/kube-arangodb/pkg/util/retry" diff --git a/pkg/operator/operator_local_storage.go b/pkg/operator/operator_local_storage.go index 519e4d97b..a58f6764c 100644 --- a/pkg/operator/operator_local_storage.go +++ b/pkg/operator/operator_local_storage.go @@ -21,13 +21,13 @@ package operator import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" kwatch "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/arangodb/kube-arangodb/pkg/metrics" "github.com/arangodb/kube-arangodb/pkg/storage" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/operator/server_api.go b/pkg/operator/server_api.go index bb17572d0..ac74ebfac 100644 --- a/pkg/operator/server_api.go +++ b/pkg/operator/server_api.go @@ -23,9 +23,8 @@ package operator import ( "sort" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/server" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // DeploymentOperator provides access to the deployment operator. diff --git a/pkg/operator/server_discovery_api.go b/pkg/operator/server_discovery_api.go index 8200ada68..62e850e35 100644 --- a/pkg/operator/server_discovery_api.go +++ b/pkg/operator/server_discovery_api.go @@ -24,13 +24,12 @@ import ( "context" "sort" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/server" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/operatorV2/informer.go b/pkg/operatorV2/informer.go index 551a1672c..9f1372a85 100644 --- a/pkg/operatorV2/informer.go +++ b/pkg/operatorV2/informer.go @@ -21,9 +21,10 @@ package operator import ( - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/cache" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func newResourceEventHandler(operator Operator, group, version, kind string) cache.ResourceEventHandler { diff --git a/pkg/operatorV2/operation/item.go b/pkg/operatorV2/operation/item.go index d1c9f8891..e21b6f763 100644 --- a/pkg/operatorV2/operation/item.go +++ b/pkg/operatorV2/operation/item.go @@ -23,8 +23,9 @@ package operation import ( "strings" - "github.com/arangodb/kube-arangodb/pkg/util/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // Operation declares operation string representation diff --git a/pkg/operatorV2/operator.go b/pkg/operatorV2/operator.go index ad597fe7e..68f709023 100644 --- a/pkg/operatorV2/operator.go +++ b/pkg/operatorV2/operator.go @@ -24,15 +24,13 @@ import ( "sync" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/prometheus/client_golang/prometheus" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // Starter interface used by Operator to start new GoRoutines diff --git a/pkg/operatorV2/operator_suite_test.go b/pkg/operatorV2/operator_suite_test.go index eacc2b199..88dae965a 100644 --- a/pkg/operatorV2/operator_suite_test.go +++ b/pkg/operatorV2/operator_suite_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) const ( diff --git a/pkg/operatorV2/operator_test.go b/pkg/operatorV2/operator_test.go index 989c05324..de6ed98ac 100644 --- a/pkg/operatorV2/operator_test.go +++ b/pkg/operatorV2/operator_test.go @@ -22,20 +22,18 @@ package operator import ( "context" + "testing" "time" - "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" - "github.com/stretchr/testify/assert" - - "testing" - "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" + + "github.com/arangodb/kube-arangodb/pkg/operatorV2/operation" ) func Test_Operator_InformerProcessing(t *testing.T) { diff --git a/pkg/replication/deployment_replication.go b/pkg/replication/deployment_replication.go index e11b2d34e..752cd1009 100644 --- a/pkg/replication/deployment_replication.go +++ b/pkg/replication/deployment_replication.go @@ -26,19 +26,19 @@ import ( "sync/atomic" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - + "github.com/rs/zerolog" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "github.com/arangodb/arangosync-client/client" + api "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/arangodb/kube-arangodb/pkg/util/retry" "github.com/arangodb/kube-arangodb/pkg/util/trigger" - "github.com/rs/zerolog" ) var logger = logging.Global().RegisterAndGetLogger("deployment-replication", logging.Info) diff --git a/pkg/replication/finalizers.go b/pkg/replication/finalizers.go index 292cf7b1f..3b477395f 100644 --- a/pkg/replication/finalizers.go +++ b/pkg/replication/finalizers.go @@ -24,14 +24,14 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/arangosync-client/client" + api "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/replication/sync_client.go b/pkg/replication/sync_client.go index 9a6712c38..211536cb7 100644 --- a/pkg/replication/sync_client.go +++ b/pkg/replication/sync_client.go @@ -25,17 +25,17 @@ import ( "net" "strconv" - "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/rs/zerolog/log" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" certificates "github.com/arangodb-helper/go-certificates" "github.com/arangodb/arangosync-client/client" "github.com/arangodb/arangosync-client/tasks" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - "github.com/rs/zerolog/log" ) // createSyncMasterClient creates an arangosync client for the given endpoint. diff --git a/pkg/replication/sync_inspector.go b/pkg/replication/sync_inspector.go index 21c600d22..a140ef202 100644 --- a/pkg/replication/sync_inspector.go +++ b/pkg/replication/sync_inspector.go @@ -25,10 +25,10 @@ import ( "sort" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/arangosync-client/client" + api "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // inspectDeploymentReplication inspects the entire deployment replication diff --git a/pkg/server/auth.go b/pkg/server/auth.go index 8b09694e6..7b6d342c5 100644 --- a/pkg/server/auth.go +++ b/pkg/server/auth.go @@ -27,15 +27,14 @@ import ( "sync" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/dchest/uniuri" "github.com/gin-gonic/gin" - - "github.com/arangodb/kube-arangodb/pkg/logging" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - typedv1 "k8s.io/client-go/kubernetes/typed/core/v1" + typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( @@ -46,7 +45,7 @@ const ( var authLogger = logging.Global().RegisterAndGetLogger("server-authentication", logging.Info) type serverAuthentication struct { - secrets typedv1.SecretInterface + secrets typedCore.SecretInterface admin struct { mutex sync.Mutex username string @@ -82,7 +81,7 @@ type loginResponse struct { // newServerAuthentication creates a new server authentication service // for the given arguments. -func newServerAuthentication(secrets typedv1.SecretInterface, adminSecretName string, allowAnonymous bool) *serverAuthentication { +func newServerAuthentication(secrets typedCore.SecretInterface, adminSecretName string, allowAnonymous bool) *serverAuthentication { auth := &serverAuthentication{ secrets: secrets, adminSecretName: adminSecretName, diff --git a/pkg/server/errors.go b/pkg/server/errors.go index 2e156d09f..1a064dd62 100644 --- a/pkg/server/errors.go +++ b/pkg/server/errors.go @@ -23,9 +23,9 @@ package server import ( "net/http" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/gin-gonic/gin" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) var ( diff --git a/pkg/server/handlers.go b/pkg/server/handlers.go index b8d8ebeed..13cab0880 100644 --- a/pkg/server/handlers.go +++ b/pkg/server/handlers.go @@ -23,8 +23,9 @@ package server import ( "net/http" - "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/gin-gonic/gin" + + "github.com/arangodb/kube-arangodb/pkg/logging" ) var serverLogger = logging.Global().RegisterAndGetLogger("server", logging.Info) diff --git a/pkg/server/server.go b/pkg/server/server.go index 0294d2769..a09aeee01 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -27,21 +27,20 @@ import ( "strings" "time" - operatorHTTP "github.com/arangodb/kube-arangodb/pkg/util/http" - "github.com/arangodb/kube-arangodb/pkg/version" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb-helper/go-certificates" "github.com/gin-gonic/gin" "github.com/jessevdk/go-assets" prometheus "github.com/prometheus/client_golang/prometheus/promhttp" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" + typedCore "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/arangodb-helper/go-certificates" "github.com/arangodb/kube-arangodb/dashboard" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + operatorHTTP "github.com/arangodb/kube-arangodb/pkg/util/http" "github.com/arangodb/kube-arangodb/pkg/util/probe" + "github.com/arangodb/kube-arangodb/pkg/version" ) // Config settings for the Server @@ -71,7 +70,7 @@ type Dependencies struct { Apps OperatorDependency ClusterSync OperatorDependency Operators Operators - Secrets corev1.SecretInterface + Secrets typedCore.SecretInterface } // Operators is the API provided to the server for accessing the various operators. @@ -95,7 +94,7 @@ type Server struct { } // NewServer creates a new server, fetching/preparing a TLS certificate. -func NewServer(cli corev1.CoreV1Interface, cfg Config, deps Dependencies) (*Server, error) { +func NewServer(cli typedCore.CoreV1Interface, cfg Config, deps Dependencies) (*Server, error) { httpServer := &http.Server{ Addr: cfg.Address, ReadTimeout: time.Second * 30, diff --git a/pkg/storage/clients.go b/pkg/storage/clients.go index 39d0e8512..0406756cf 100644 --- a/pkg/storage/clients.go +++ b/pkg/storage/clients.go @@ -24,10 +24,9 @@ import ( "context" "fmt" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner/client" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/storage/daemon_set.go b/pkg/storage/daemon_set.go index abf46a55d..d532ee6ec 100644 --- a/pkg/storage/daemon_set.go +++ b/pkg/storage/daemon_set.go @@ -25,17 +25,15 @@ import ( "fmt" "strconv" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/util" - apps "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/storage/daemon_set_test.go b/pkg/storage/daemon_set_test.go index 87d206581..45d231276 100644 --- a/pkg/storage/daemon_set_test.go +++ b/pkg/storage/daemon_set_test.go @@ -23,9 +23,10 @@ package storage import ( "testing" - api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" ) // TestEnsureDaemonSet tests ensureDaemonSet() method diff --git a/pkg/storage/image.go b/pkg/storage/image.go index 4550e46c0..5f5fcede2 100644 --- a/pkg/storage/image.go +++ b/pkg/storage/image.go @@ -23,10 +23,11 @@ package storage import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // getMyImage fetched the docker image from my own pod diff --git a/pkg/storage/image_test.go b/pkg/storage/image_test.go index 292640776..d809fdac1 100644 --- a/pkg/storage/image_test.go +++ b/pkg/storage/image_test.go @@ -25,10 +25,10 @@ import ( "testing" "github.com/stretchr/testify/require" - - "github.com/arangodb/kube-arangodb/pkg/util/kclient" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/kclient" ) // TestGetMyImage tests getMyImage() method diff --git a/pkg/storage/local_storage.go b/pkg/storage/local_storage.go index f9e2f73f7..a7f22aab3 100644 --- a/pkg/storage/local_storage.go +++ b/pkg/storage/local_storage.go @@ -26,19 +26,18 @@ import ( "sync/atomic" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - + "github.com/rs/zerolog" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/arangodb/kube-arangodb/pkg/util/retry" "github.com/arangodb/kube-arangodb/pkg/util/trigger" - "github.com/rs/zerolog" ) var logger = logging.Global().RegisterAndGetLogger("deployment-storage", logging.Info) diff --git a/pkg/storage/provisioner/client/client.go b/pkg/storage/provisioner/client/client.go index bbc46fc05..9b70fc494 100644 --- a/pkg/storage/provisioner/client/client.go +++ b/pkg/storage/provisioner/client/client.go @@ -32,9 +32,8 @@ import ( "net/url" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // New creates a new client for the provisioner API. diff --git a/pkg/storage/provisioner/mocks/provisioner.go b/pkg/storage/provisioner/mocks/provisioner.go index 4df6b4546..dc3597955 100644 --- a/pkg/storage/provisioner/mocks/provisioner.go +++ b/pkg/storage/provisioner/mocks/provisioner.go @@ -23,11 +23,10 @@ package mocks import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/stretchr/testify/mock" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) type Provisioner interface { diff --git a/pkg/storage/provisioner/service/provisioner.go b/pkg/storage/provisioner/service/provisioner.go index 486867e95..278993b32 100644 --- a/pkg/storage/provisioner/service/provisioner.go +++ b/pkg/storage/provisioner/service/provisioner.go @@ -24,13 +24,12 @@ import ( "context" "os" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/rs/zerolog" "golang.org/x/sys/unix" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) var logger = logging.Global().RegisterAndGetLogger("deployment-storage-service", logging.Info) diff --git a/pkg/storage/provisioner/service/server.go b/pkg/storage/provisioner/service/server.go index 2a2b348b9..734ed70b3 100644 --- a/pkg/storage/provisioner/service/server.go +++ b/pkg/storage/provisioner/service/server.go @@ -26,12 +26,11 @@ import ( "io/ioutil" "net/http" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/julienschmidt/httprouter" "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/storage/pv_cleanup.go b/pkg/storage/pv_cleanup.go index 0c4f6a0be..9bd176edc 100644 --- a/pkg/storage/pv_cleanup.go +++ b/pkg/storage/pv_cleanup.go @@ -25,8 +25,6 @@ import ( "sync" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/rs/zerolog" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,6 +32,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/logging" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/arangodb/kube-arangodb/pkg/util/trigger" ) diff --git a/pkg/storage/pv_creator.go b/pkg/storage/pv_creator.go index df494f726..8bc0881d0 100644 --- a/pkg/storage/pv_creator.go +++ b/pkg/storage/pv_creator.go @@ -32,17 +32,15 @@ import ( "strings" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "k8s.io/apimachinery/pkg/api/resource" - "github.com/dchest/uniuri" core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/storage/pv_inspector.go b/pkg/storage/pv_inspector.go index 4ecc4d9d0..6cc1a3d16 100644 --- a/pkg/storage/pv_inspector.go +++ b/pkg/storage/pv_inspector.go @@ -24,10 +24,10 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // inspectPVs queries all PersistentVolume's and triggers a cleanup for diff --git a/pkg/storage/pvc_inspector.go b/pkg/storage/pvc_inspector.go index 8dd7a3fa3..51bf8d1b6 100644 --- a/pkg/storage/pvc_inspector.go +++ b/pkg/storage/pvc_inspector.go @@ -23,9 +23,10 @@ package storage import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // inspectPVCs queries all PVC's and checks if there is a need to diff --git a/pkg/storage/server_api.go b/pkg/storage/server_api.go index 23713c7aa..76ceced8b 100644 --- a/pkg/storage/server_api.go +++ b/pkg/storage/server_api.go @@ -24,9 +24,10 @@ import ( "context" "sort" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/arangodb/kube-arangodb/pkg/server" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Name returns the name of the local storage resource diff --git a/pkg/storage/server_volume_api.go b/pkg/storage/server_volume_api.go index 97a5b0907..4d17ccfd1 100644 --- a/pkg/storage/server_volume_api.go +++ b/pkg/storage/server_volume_api.go @@ -21,8 +21,9 @@ package storage import ( - "github.com/arangodb/kube-arangodb/pkg/server" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/server" ) type serverVolume core.PersistentVolume diff --git a/pkg/storage/service.go b/pkg/storage/service.go index e5f6dd88c..fa7b48398 100644 --- a/pkg/storage/service.go +++ b/pkg/storage/service.go @@ -23,12 +23,12 @@ package storage import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" "github.com/arangodb/kube-arangodb/pkg/storage/provisioner" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/storage/storage_class.go b/pkg/storage/storage_class.go index 4a08d2c44..b59cd8fe4 100644 --- a/pkg/storage/storage_class.go +++ b/pkg/storage/storage_class.go @@ -23,12 +23,12 @@ package storage import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" core "k8s.io/api/core/v1" v1 "k8s.io/api/storage/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/storage/utils_test.go b/pkg/storage/utils_test.go index 7bc357e8b..c10fd84f3 100644 --- a/pkg/storage/utils_test.go +++ b/pkg/storage/utils_test.go @@ -26,14 +26,15 @@ import ( "strings" "testing" - api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" - "github.com/arangodb/kube-arangodb/pkg/logging" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/dchest/uniuri" "github.com/stretchr/testify/require" apps "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" + "github.com/arangodb/kube-arangodb/pkg/logging" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" ) func generateDaemonSet(t *testing.T, podSpec core.PodSpec, lsSpec api.LocalStorageSpec) (*LocalStorage, *apps.DaemonSet) { diff --git a/pkg/upgrade/member_cid_append_test.go b/pkg/upgrade/member_cid_append_test.go index 7116ae433..bff7d11ed 100644 --- a/pkg/upgrade/member_cid_append_test.go +++ b/pkg/upgrade/member_cid_append_test.go @@ -23,9 +23,10 @@ package upgrade import ( "testing" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/uuid" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) func testMemberCIDAppendPrepare(t *testing.T, obj *api.ArangoDeployment) { diff --git a/pkg/upgrade/upgrade.go b/pkg/upgrade/upgrade.go index f2c691b07..f3d1a553a 100644 --- a/pkg/upgrade/upgrade.go +++ b/pkg/upgrade/upgrade.go @@ -24,9 +24,10 @@ import ( "sort" "sync" + "github.com/pkg/errors" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - "github.com/pkg/errors" ) var ( diff --git a/pkg/upgrade/upgrade_test.go b/pkg/upgrade/upgrade_test.go index 8ea5cdf17..abd653f49 100644 --- a/pkg/upgrade/upgrade_test.go +++ b/pkg/upgrade/upgrade_test.go @@ -23,11 +23,12 @@ package upgrade import ( "testing" + "github.com/stretchr/testify/require" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/arangodb/kube-arangodb/pkg/util/tests" - "github.com/stretchr/testify/require" ) func genNewVersionAppender(v *[]api.Version, version api.Version) Upgrade { diff --git a/pkg/util/arangod/client.go b/pkg/util/arangod/client.go index 07caa38fa..0bdeecafe 100644 --- a/pkg/util/arangod/client.go +++ b/pkg/util/arangod/client.go @@ -28,17 +28,16 @@ import ( "strconv" "time" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" + typedCore "k8s.io/client-go/kubernetes/typed/core/v1" driver "github.com/arangodb/go-driver" "github.com/arangodb/go-driver/http" "github.com/arangodb/go-driver/jwt" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) @@ -115,7 +114,7 @@ var ( ) // CreateArangodClient creates a go-driver client for a specific member in the given group. -func CreateArangodClient(ctx context.Context, cli corev1.CoreV1Interface, apiObject *api.ArangoDeployment, group api.ServerGroup, id string) (driver.Client, error) { +func CreateArangodClient(ctx context.Context, cli typedCore.CoreV1Interface, apiObject *api.ArangoDeployment, group api.ServerGroup, id string) (driver.Client, error) { // Create connection dnsName := k8sutil.CreatePodDNSNameWithDomain(apiObject, apiObject.Spec.ClusterDomain, group.AsRole(), id) c, err := createArangodClientForDNSName(ctx, cli, apiObject, dnsName, false) @@ -126,7 +125,7 @@ func CreateArangodClient(ctx context.Context, cli corev1.CoreV1Interface, apiObj } // CreateArangodDatabaseClient creates a go-driver client for accessing the entire cluster (or single server). -func CreateArangodDatabaseClient(ctx context.Context, cli corev1.CoreV1Interface, apiObject *api.ArangoDeployment, shortTimeout bool) (driver.Client, error) { +func CreateArangodDatabaseClient(ctx context.Context, cli typedCore.CoreV1Interface, apiObject *api.ArangoDeployment, shortTimeout bool) (driver.Client, error) { // Create connection dnsName := k8sutil.CreateDatabaseClientServiceDNSNameWithDomain(apiObject, apiObject.Spec.ClusterDomain) c, err := createArangodClientForDNSName(ctx, cli, apiObject, dnsName, shortTimeout) @@ -148,7 +147,7 @@ func CreateArangodImageIDClient(ctx context.Context, deployment k8sutil.APIObjec } // CreateArangodClientForDNSName creates a go-driver client for a given DNS name. -func createArangodClientForDNSName(ctx context.Context, cli corev1.CoreV1Interface, apiObject *api.ArangoDeployment, dnsName string, shortTimeout bool) (driver.Client, error) { +func createArangodClientForDNSName(ctx context.Context, cli typedCore.CoreV1Interface, apiObject *api.ArangoDeployment, dnsName string, shortTimeout bool) (driver.Client, error) { connConfig := createArangodHTTPConfigForDNSNames(apiObject, []string{dnsName}, shortTimeout) // TODO deal with TLS with proper CA checking conn, err := http.NewConnection(connConfig) @@ -197,7 +196,7 @@ func createArangodHTTPConfigForDNSNames(apiObject *api.ArangoDeployment, dnsName } // createArangodClientAuthentication creates a go-driver authentication for the servers in the given deployment. -func createArangodClientAuthentication(ctx context.Context, cli corev1.CoreV1Interface, apiObject *api.ArangoDeployment) (driver.Authentication, error) { +func createArangodClientAuthentication(ctx context.Context, cli typedCore.CoreV1Interface, apiObject *api.ArangoDeployment) (driver.Authentication, error) { if apiObject != nil && apiObject.Spec.IsAuthenticated() { // Authentication is enabled. // Should we skip using it? diff --git a/pkg/util/arangod/cluster.go b/pkg/util/arangod/cluster.go index 7af320948..ce7bfebda 100644 --- a/pkg/util/arangod/cluster.go +++ b/pkg/util/arangod/cluster.go @@ -23,9 +23,9 @@ package arangod import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - driver "github.com/arangodb/go-driver" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // NumberOfServers is the JSON structure return for the numberOfServers API call. diff --git a/pkg/util/arangod/conn/async.go b/pkg/util/arangod/conn/async.go index 49fb22b3b..a70bc35a3 100644 --- a/pkg/util/arangod/conn/async.go +++ b/pkg/util/arangod/conn/async.go @@ -26,6 +26,7 @@ import ( "path" "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/errors" ) diff --git a/pkg/util/arangod/conn/async_errors_test.go b/pkg/util/arangod/conn/async_errors_test.go index 1e0cb2be7..d5551fb30 100644 --- a/pkg/util/arangod/conn/async_errors_test.go +++ b/pkg/util/arangod/conn/async_errors_test.go @@ -23,8 +23,9 @@ package conn import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func Test_IsAsyncErrorNotFound_Loop(t *testing.T) { diff --git a/pkg/util/arangod/conn/async_test.go b/pkg/util/arangod/conn/async_test.go index ffdc84765..a9724e3fd 100644 --- a/pkg/util/arangod/conn/async_test.go +++ b/pkg/util/arangod/conn/async_test.go @@ -25,9 +25,11 @@ import ( "net/http" "testing" - "github.com/arangodb/go-driver" - "github.com/arangodb/kube-arangodb/pkg/util/tests" "github.com/stretchr/testify/require" + + "github.com/arangodb/go-driver" + + "github.com/arangodb/kube-arangodb/pkg/util/tests" ) func Test_Async(t *testing.T) { diff --git a/pkg/util/arangod/dbserver.go b/pkg/util/arangod/dbserver.go index 667131f4b..e342b4be9 100644 --- a/pkg/util/arangod/dbserver.go +++ b/pkg/util/arangod/dbserver.go @@ -23,11 +23,10 @@ package arangod import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" + driver "github.com/arangodb/go-driver" "github.com/arangodb/kube-arangodb/pkg/util/errors" - - driver "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/util/globals" ) // IsDBServerEmpty checks if the dbserver identified by the given ID no longer has any diff --git a/pkg/util/arangod/driver_init.go b/pkg/util/arangod/driver_init.go index 8c502cfe3..ab27a1115 100644 --- a/pkg/util/arangod/driver_init.go +++ b/pkg/util/arangod/driver_init.go @@ -22,6 +22,7 @@ package arangod import ( driver "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) diff --git a/pkg/util/crd/crd.go b/pkg/util/crd/crd.go index 4b4c45105..13d72f51f 100644 --- a/pkg/util/crd/crd.go +++ b/pkg/util/crd/crd.go @@ -24,12 +24,11 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/retry" ) diff --git a/pkg/util/errors/errors.go b/pkg/util/errors/errors.go index 69d0ea2a8..7afc44fc2 100644 --- a/pkg/util/errors/errors.go +++ b/pkg/util/errors/errors.go @@ -32,6 +32,7 @@ import ( errs "github.com/pkg/errors" driver "github.com/arangodb/go-driver" + "github.com/arangodb/kube-arangodb/pkg/logging" ) diff --git a/pkg/util/k8sutil/affinity.go b/pkg/util/k8sutil/affinity.go index 501963807..74bfd696b 100644 --- a/pkg/util/k8sutil/affinity.go +++ b/pkg/util/k8sutil/affinity.go @@ -21,9 +21,10 @@ package k8sutil import ( - "github.com/arangodb/kube-arangodb/pkg/apis/shared" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) // CreateAffinity creates pod anti-affinity for the given role. diff --git a/pkg/util/k8sutil/affinity_test.go b/pkg/util/k8sutil/affinity_test.go index e92e23150..8405340c0 100644 --- a/pkg/util/k8sutil/affinity_test.go +++ b/pkg/util/k8sutil/affinity_test.go @@ -23,11 +23,11 @@ package k8sutil import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestCreateAffinity(t *testing.T) { diff --git a/pkg/util/k8sutil/dns.go b/pkg/util/k8sutil/dns.go index 6761eefe2..c390637b9 100644 --- a/pkg/util/k8sutil/dns.go +++ b/pkg/util/k8sutil/dns.go @@ -24,9 +24,9 @@ import ( "fmt" core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) func appendDeploymentClusterDomain(dns string, domain *string) string { diff --git a/pkg/util/k8sutil/dns_test.go b/pkg/util/k8sutil/dns_test.go index 73bc45fc9..d21112a31 100644 --- a/pkg/util/k8sutil/dns_test.go +++ b/pkg/util/k8sutil/dns_test.go @@ -23,11 +23,10 @@ package k8sutil import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util" - "github.com/stretchr/testify/assert" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util" ) // TestCreatePodDNSName tests CreatePodDNSName. diff --git a/pkg/util/k8sutil/errors.go b/pkg/util/k8sutil/errors.go index 291c6db7a..04cf081bf 100644 --- a/pkg/util/k8sutil/errors.go +++ b/pkg/util/k8sutil/errors.go @@ -21,8 +21,9 @@ package k8sutil import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // IsAlreadyExists returns true if the given error is or is caused by a diff --git a/pkg/util/k8sutil/errors_test.go b/pkg/util/k8sutil/errors_test.go index 84d306eb8..6ca4dc95a 100644 --- a/pkg/util/k8sutil/errors_test.go +++ b/pkg/util/k8sutil/errors_test.go @@ -24,12 +24,12 @@ import ( "os" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/stretchr/testify/assert" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation/field" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) var ( diff --git a/pkg/util/k8sutil/events.go b/pkg/util/k8sutil/events.go index 3f0d19958..311697b54 100644 --- a/pkg/util/k8sutil/events.go +++ b/pkg/util/k8sutil/events.go @@ -24,11 +24,12 @@ import ( "fmt" "strings" - driver "github.com/arangodb/go-driver" - upgraderules "github.com/arangodb/go-upgrade-rules" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + + driver "github.com/arangodb/go-driver" + upgraderules "github.com/arangodb/go-upgrade-rules" ) // Event is used to create events using an EventRecorder. diff --git a/pkg/util/k8sutil/finalizers.go b/pkg/util/k8sutil/finalizers.go index d95927c10..282b316d6 100644 --- a/pkg/util/k8sutil/finalizers.go +++ b/pkg/util/k8sutil/finalizers.go @@ -23,16 +23,15 @@ package k8sutil import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod" - - "github.com/arangodb/kube-arangodb/pkg/util/errors" - persistentvolumeclaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" - podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim" + persistentvolumeclaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod" + podv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod/v1" ) const ( diff --git a/pkg/util/k8sutil/images_test.go b/pkg/util/k8sutil/images_test.go index 45d2e59f5..a5e369c8c 100644 --- a/pkg/util/k8sutil/images_test.go +++ b/pkg/util/k8sutil/images_test.go @@ -23,10 +23,11 @@ package k8sutil import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) func TestGetArangoDBImageIDFromPod(t *testing.T) { diff --git a/pkg/util/k8sutil/informer.go b/pkg/util/k8sutil/informer.go index 9b67a151e..d1bfb1281 100644 --- a/pkg/util/k8sutil/informer.go +++ b/pkg/util/k8sutil/informer.go @@ -21,10 +21,11 @@ package k8sutil import ( - "github.com/arangodb/kube-arangodb/pkg/logging" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/cache" + + "github.com/arangodb/kube-arangodb/pkg/logging" ) var ( diff --git a/pkg/util/k8sutil/inspector/arangoclustersynchronization/v1/reader.go b/pkg/util/k8sutil/inspector/arangoclustersynchronization/v1/reader.go index 33e6ad24d..e70982ba7 100644 --- a/pkg/util/k8sutil/inspector/arangoclustersynchronization/v1/reader.go +++ b/pkg/util/k8sutil/inspector/arangoclustersynchronization/v1/reader.go @@ -23,9 +23,10 @@ package v1 import ( "context" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) // ModInterface has methods to work with GetSimple resources only for creation diff --git a/pkg/util/k8sutil/inspector/arangomember/v1/filters.go b/pkg/util/k8sutil/inspector/arangomember/v1/filters.go index a972a4d3a..13510eda5 100644 --- a/pkg/util/k8sutil/inspector/arangomember/v1/filters.go +++ b/pkg/util/k8sutil/inspector/arangomember/v1/filters.go @@ -21,8 +21,9 @@ package v1 import ( - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "k8s.io/apimachinery/pkg/types" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) func FilterByDeploymentUID(uid types.UID) Filter { diff --git a/pkg/util/k8sutil/inspector/arangomember/v1/reader.go b/pkg/util/k8sutil/inspector/arangomember/v1/reader.go index 164d36bd6..fdcfc8e31 100644 --- a/pkg/util/k8sutil/inspector/arangomember/v1/reader.go +++ b/pkg/util/k8sutil/inspector/arangomember/v1/reader.go @@ -23,9 +23,10 @@ package v1 import ( "context" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) // ModInterface has methods to work with ArangoMember resources only for creation diff --git a/pkg/util/k8sutil/inspector/arangotask/v1/reader.go b/pkg/util/k8sutil/inspector/arangotask/v1/reader.go index c7c222c50..dded62250 100644 --- a/pkg/util/k8sutil/inspector/arangotask/v1/reader.go +++ b/pkg/util/k8sutil/inspector/arangotask/v1/reader.go @@ -23,9 +23,10 @@ package v1 import ( "context" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) // ModInterface has methods to work with ArangoTask resources only for creation diff --git a/pkg/util/k8sutil/inspector/endpoints/v1/loader.go b/pkg/util/k8sutil/inspector/endpoints/v1/loader.go index 17bba65b1..6d6067124 100644 --- a/pkg/util/k8sutil/inspector/endpoints/v1/loader.go +++ b/pkg/util/k8sutil/inspector/endpoints/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) type Inspector interface { diff --git a/pkg/util/k8sutil/inspector/inspector.go b/pkg/util/k8sutil/inspector/inspector.go index 7d952de83..5bff26f51 100644 --- a/pkg/util/k8sutil/inspector/inspector.go +++ b/pkg/util/k8sutil/inspector/inspector.go @@ -21,12 +21,11 @@ package inspector import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/node" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/refresh" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/server" - "context" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangoclustersynchronization" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangodeployment" @@ -34,17 +33,18 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/arangotask" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/endpoints" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/mods" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/node" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/poddisruptionbudget" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/refresh" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/server" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" ) type Object interface { diff --git a/pkg/util/k8sutil/inspector/node/v1/loader.go b/pkg/util/k8sutil/inspector/node/v1/loader.go index 87ca7779a..f59878000 100644 --- a/pkg/util/k8sutil/inspector/node/v1/loader.go +++ b/pkg/util/k8sutil/inspector/node/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) type Inspector interface { diff --git a/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1/loader.go b/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1/loader.go index 911a13f53..12fe2b124 100644 --- a/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1/loader.go +++ b/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) type Inspector interface { diff --git a/pkg/util/k8sutil/inspector/pod/v1/loader.go b/pkg/util/k8sutil/inspector/pod/v1/loader.go index 3606ef7a2..a7b94bc1d 100644 --- a/pkg/util/k8sutil/inspector/pod/v1/loader.go +++ b/pkg/util/k8sutil/inspector/pod/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) type Inspector interface { diff --git a/pkg/util/k8sutil/inspector/secret/v1/loader.go b/pkg/util/k8sutil/inspector/secret/v1/loader.go index 3356d1b8d..3bdf6d689 100644 --- a/pkg/util/k8sutil/inspector/secret/v1/loader.go +++ b/pkg/util/k8sutil/inspector/secret/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) // Inspector for secrets diff --git a/pkg/util/k8sutil/inspector/service/v1/loader.go b/pkg/util/k8sutil/inspector/service/v1/loader.go index f86a70475..e116f2a24 100644 --- a/pkg/util/k8sutil/inspector/service/v1/loader.go +++ b/pkg/util/k8sutil/inspector/service/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) type Inspector interface { diff --git a/pkg/util/k8sutil/inspector/serviceaccount/v1/loader.go b/pkg/util/k8sutil/inspector/serviceaccount/v1/loader.go index f79ba0a65..2300261b4 100644 --- a/pkg/util/k8sutil/inspector/serviceaccount/v1/loader.go +++ b/pkg/util/k8sutil/inspector/serviceaccount/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" core "k8s.io/api/core/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) type Inspector interface { diff --git a/pkg/util/k8sutil/inspector/serviceaccount/v1/reader.go b/pkg/util/k8sutil/inspector/serviceaccount/v1/reader.go index 94e2ce32e..2b9838374 100644 --- a/pkg/util/k8sutil/inspector/serviceaccount/v1/reader.go +++ b/pkg/util/k8sutil/inspector/serviceaccount/v1/reader.go @@ -23,10 +23,11 @@ package v1 import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) // ModInterface has methods to work with ServiceAccount resources only for creation diff --git a/pkg/util/k8sutil/inspector/servicemonitor/v1/loader.go b/pkg/util/k8sutil/inspector/servicemonitor/v1/loader.go index b826f97b1..9b559ecd4 100644 --- a/pkg/util/k8sutil/inspector/servicemonitor/v1/loader.go +++ b/pkg/util/k8sutil/inspector/servicemonitor/v1/loader.go @@ -21,8 +21,9 @@ package v1 import ( - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/gvk" ) type Inspector interface { diff --git a/pkg/util/k8sutil/inspector/servicemonitor/v1/reader.go b/pkg/util/k8sutil/inspector/servicemonitor/v1/reader.go index 394f6664a..f7e607149 100644 --- a/pkg/util/k8sutil/inspector/servicemonitor/v1/reader.go +++ b/pkg/util/k8sutil/inspector/servicemonitor/v1/reader.go @@ -23,10 +23,11 @@ package v1 import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/anonymous" ) // ModInterface has methods to work with ServiceMonitor resources only for creation diff --git a/pkg/util/k8sutil/interfaces/pod_creator.go b/pkg/util/k8sutil/interfaces/pod_creator.go index 520d09af8..ba2220b1d 100644 --- a/pkg/util/k8sutil/interfaces/pod_creator.go +++ b/pkg/util/k8sutil/interfaces/pod_creator.go @@ -23,9 +23,10 @@ package interfaces import ( "context" + core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" - core "k8s.io/api/core/v1" ) type Inspector interface { diff --git a/pkg/util/k8sutil/license_test.go b/pkg/util/k8sutil/license_test.go index 5ec03b7ce..1990afdc9 100644 --- a/pkg/util/k8sutil/license_test.go +++ b/pkg/util/k8sutil/license_test.go @@ -27,13 +27,14 @@ import ( "fmt" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/constants" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/arangodb/kube-arangodb/pkg/util/tests" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" + + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" + "github.com/arangodb/kube-arangodb/pkg/util/tests" ) func encodeLicenseKey(in string) string { diff --git a/pkg/util/k8sutil/lifecycle.go b/pkg/util/k8sutil/lifecycle.go index d4a11f6af..0f3eda464 100644 --- a/pkg/util/k8sutil/lifecycle.go +++ b/pkg/util/k8sutil/lifecycle.go @@ -24,11 +24,10 @@ import ( "os" "path/filepath" - "github.com/arangodb/kube-arangodb/pkg/util/errors" + core "k8s.io/api/core/v1" "github.com/arangodb/kube-arangodb/pkg/util/constants" - - core "k8s.io/api/core/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) const ( diff --git a/pkg/util/k8sutil/names/id.go b/pkg/util/k8sutil/names/id.go index c74e307be..d7f3f2433 100644 --- a/pkg/util/k8sutil/names/id.go +++ b/pkg/util/k8sutil/names/id.go @@ -24,8 +24,9 @@ import ( "fmt" "strings" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/dchest/uniuri" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" ) func GetArangodID(group api.ServerGroup) string { diff --git a/pkg/util/k8sutil/owner.go b/pkg/util/k8sutil/owner.go index fc1935e2c..1a76bf713 100644 --- a/pkg/util/k8sutil/owner.go +++ b/pkg/util/k8sutil/owner.go @@ -23,12 +23,12 @@ package k8sutil import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/errors" appsv1 "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) // GetPodOwner returns the ReplicaSet that owns the given Pod. diff --git a/pkg/util/k8sutil/pods_test.go b/pkg/util/k8sutil/pods_test.go index 293295d5b..6333afba4 100644 --- a/pkg/util/k8sutil/pods_test.go +++ b/pkg/util/k8sutil/pods_test.go @@ -24,10 +24,10 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" "github.com/arangodb/kube-arangodb/pkg/handlers/utils" - "github.com/stretchr/testify/require" ) // TestIsPodReady tests IsPodReady. diff --git a/pkg/util/k8sutil/probes/probes.go b/pkg/util/k8sutil/probes/probes.go index 8eadb7e54..4591bd71a 100644 --- a/pkg/util/k8sutil/probes/probes.go +++ b/pkg/util/k8sutil/probes/probes.go @@ -21,10 +21,11 @@ package probes import ( - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/apis/shared" core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/apis/shared" ) // HTTPProbeConfig contains settings for creating a liveness/readiness probe. diff --git a/pkg/util/k8sutil/pvc.go b/pkg/util/k8sutil/pvc.go index f47fc4e72..04558fc3a 100644 --- a/pkg/util/k8sutil/pvc.go +++ b/pkg/util/k8sutil/pvc.go @@ -24,12 +24,11 @@ import ( "context" "strconv" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" persistentvolumeclaimv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim/v1" ) diff --git a/pkg/util/k8sutil/secrets.go b/pkg/util/k8sutil/secrets.go index b981fcb6e..289a2acaa 100644 --- a/pkg/util/k8sutil/secrets.go +++ b/pkg/util/k8sutil/secrets.go @@ -23,14 +23,14 @@ package k8sutil import ( "context" - "github.com/arangodb/kube-arangodb/pkg/util/globals" - - "github.com/arangodb/kube-arangodb/pkg/util/constants" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" jg "github.com/golang-jwt/jwt" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/globals" + secretv1 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret/v1" ) // ValidateEncryptionKeySecret checks that a secret with given name in given namespace diff --git a/pkg/util/k8sutil/storageclass.go b/pkg/util/k8sutil/storageclass.go index 7841b233f..eef2a9a3d 100644 --- a/pkg/util/k8sutil/storageclass.go +++ b/pkg/util/k8sutil/storageclass.go @@ -25,12 +25,12 @@ import ( "strconv" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/util/retry" v1 "k8s.io/api/storage/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/retry" ) var ( diff --git a/pkg/util/k8sutil/storageclass_test.go b/pkg/util/k8sutil/storageclass_test.go index b0f8c6bb2..97a4c07b1 100644 --- a/pkg/util/k8sutil/storageclass_test.go +++ b/pkg/util/k8sutil/storageclass_test.go @@ -24,18 +24,17 @@ import ( "context" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - - "github.com/arangodb/kube-arangodb/pkg/util/retry" - "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/runtime" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" v1 "k8s.io/api/storage/v1" er "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/fake" k8stesting "k8s.io/client-go/testing" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/retry" ) func TestStorageClassIsDefault(t *testing.T) { diff --git a/pkg/util/k8sutil/test/events_test.go b/pkg/util/k8sutil/test/events_test.go index 2421b1a2a..932db0044 100644 --- a/pkg/util/k8sutil/test/events_test.go +++ b/pkg/util/k8sutil/test/events_test.go @@ -23,14 +23,12 @@ package test import ( "testing" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/stretchr/testify/assert" - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) diff --git a/pkg/util/k8sutil/tls/tls.go b/pkg/util/k8sutil/tls/tls.go index e0a3eddd3..c070fd855 100644 --- a/pkg/util/k8sutil/tls/tls.go +++ b/pkg/util/k8sutil/tls/tls.go @@ -23,13 +23,13 @@ package tls import ( "net/url" + core "k8s.io/api/core/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/apis/shared" "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) type KeyfileInput struct { diff --git a/pkg/util/kclient/client.go b/pkg/util/kclient/client.go index b9ca1aebe..d96d33024 100644 --- a/pkg/util/kclient/client.go +++ b/pkg/util/kclient/client.go @@ -24,10 +24,10 @@ import ( "fmt" "os" - "github.com/arangodb/kube-arangodb/pkg/util" + "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/rest" + "github.com/arangodb/kube-arangodb/pkg/util" ) const Kubeconfig util.EnvironmentVariable = "KUBECONFIG" diff --git a/pkg/util/kclient/client_factory.go b/pkg/util/kclient/client_factory.go index 816a127ae..6dd20399c 100644 --- a/pkg/util/kclient/client_factory.go +++ b/pkg/util/kclient/client_factory.go @@ -23,13 +23,14 @@ package kclient import ( "sync" - "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" "github.com/dchest/uniuri" "github.com/pkg/errors" monitoring "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned" apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + + "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" ) const ( diff --git a/pkg/util/kclient/helpers/secret.go b/pkg/util/kclient/helpers/secret.go index 6a6ac7f22..c82d45751 100644 --- a/pkg/util/kclient/helpers/secret.go +++ b/pkg/util/kclient/helpers/secret.go @@ -21,12 +21,13 @@ package helpers import ( + "github.com/pkg/errors" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" + "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/pkg/errors" - rest "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" ) func SecretConfigGetter(s secret.Inspector, name, key string) kclient.ConfigGetter { diff --git a/pkg/util/kclient/helpers/secret_test.go b/pkg/util/kclient/helpers/secret_test.go index 45acaa42c..dbbe2d7f2 100644 --- a/pkg/util/kclient/helpers/secret_test.go +++ b/pkg/util/kclient/helpers/secret_test.go @@ -24,12 +24,13 @@ import ( "context" "testing" - "github.com/arangodb/kube-arangodb/pkg/deployment/resources/inspector" - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/stretchr/testify/require" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/arangodb/kube-arangodb/pkg/deployment/resources/inspector" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" ) func Test_SecretConfigGetter(t *testing.T) { diff --git a/pkg/util/metrics/description.go b/pkg/util/metrics/description.go index f1033db4a..a6572c0d8 100644 --- a/pkg/util/metrics/description.go +++ b/pkg/util/metrics/description.go @@ -21,9 +21,10 @@ package metrics import ( - "github.com/arangodb/kube-arangodb/pkg/util" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" + + "github.com/arangodb/kube-arangodb/pkg/util" ) type Description interface { diff --git a/pkg/util/retry/retry.go b/pkg/util/retry/retry.go index 73fd4c642..6b9470170 100644 --- a/pkg/util/retry/retry.go +++ b/pkg/util/retry/retry.go @@ -24,9 +24,9 @@ import ( "context" "time" - "github.com/arangodb/kube-arangodb/pkg/util/errors" - "github.com/cenkalti/backoff" + + "github.com/arangodb/kube-arangodb/pkg/util/errors" ) type permanentError struct { diff --git a/pkg/util/tests/gen.go b/pkg/util/tests/gen.go index c35bf8696..11b9bb61e 100644 --- a/pkg/util/tests/gen.go +++ b/pkg/util/tests/gen.go @@ -24,11 +24,12 @@ import ( "context" "testing" - api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" - "github.com/arangodb/kube-arangodb/pkg/util/kclient" "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" ) func NewArangoDeployment(name string) *api.ArangoDeployment { diff --git a/pkg/util/tests/inspector.go b/pkg/util/tests/inspector.go index a461ab252..27ea2c2c4 100644 --- a/pkg/util/tests/inspector.go +++ b/pkg/util/tests/inspector.go @@ -24,11 +24,12 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources/inspector" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle" "github.com/arangodb/kube-arangodb/pkg/util/kclient" - "github.com/stretchr/testify/require" ) const FakeNamespace = "fake" diff --git a/pkg/util/tests/server.go b/pkg/util/tests/server.go index d21b351d0..0cab4ac33 100644 --- a/pkg/util/tests/server.go +++ b/pkg/util/tests/server.go @@ -28,9 +28,10 @@ import ( "sync" "testing" + "github.com/stretchr/testify/require" + "github.com/arangodb/go-driver" httpdriver "github.com/arangodb/go-driver/http" - "github.com/stretchr/testify/require" ) func NewServer(t *testing.T) Server { diff --git a/pkg/util/tests/server_async.go b/pkg/util/tests/server_async.go index 717faec0d..9d135c617 100644 --- a/pkg/util/tests/server_async.go +++ b/pkg/util/tests/server_async.go @@ -25,9 +25,10 @@ import ( "net/http" "testing" - "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/dchest/uniuri" "github.com/stretchr/testify/require" + + "github.com/arangodb/kube-arangodb/pkg/util/constants" ) func NewAsyncHandler(t *testing.T, s Server, method string, path string, retCode int, ret interface{}) AsyncHandler { diff --git a/pkg/util/times.go b/pkg/util/times.go index cd034c8c3..46bdbee19 100644 --- a/pkg/util/times.go +++ b/pkg/util/times.go @@ -22,7 +22,6 @@ package util import ( "math" - "time" meta "k8s.io/apimachinery/pkg/apis/meta/v1"