1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Linter] Update linter rules to force import ordering (#1044)

This commit is contained in:
Nikita Vanyasin 2022-07-11 14:49:47 +03:00 committed by GitHub
parent a9dee48be1
commit 8ca0835a5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
429 changed files with 1136 additions and 1157 deletions

View file

@ -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)

View file

@ -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:

View file

@ -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"

View file

@ -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)

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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() {

View file

@ -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

View file

@ -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 (

View file

@ -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 (

View file

@ -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

View file

@ -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 {

View file

@ -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 (

View file

@ -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

View file

@ -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 (

View file

@ -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

View file

@ -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

View file

@ -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) {

View file

@ -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 (

View file

@ -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.

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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

View file

@ -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) {

View file

@ -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)

View file

@ -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

View file

@ -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 (

View file

@ -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) {

View file

@ -21,9 +21,9 @@
package v1
import (
"github.com/magiconair/properties/assert"
"testing"
"github.com/magiconair/properties/assert"
)
func TestSecretHashes_Equal(t *testing.T) {

View file

@ -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 (

View file

@ -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

View file

@ -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) {

View file

@ -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 (

View file

@ -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

View file

@ -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 (

View file

@ -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) {

View file

@ -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

View file

@ -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) {

View file

@ -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"
)

View file

@ -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) {

View file

@ -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

View file

@ -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

View file

@ -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) {

View file

@ -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 (

View file

@ -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.

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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

View file

@ -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) {

View file

@ -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)

View file

@ -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

View file

@ -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 (

View file

@ -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) {

View file

@ -21,9 +21,9 @@
package v2alpha1
import (
"github.com/magiconair/properties/assert"
"testing"
"github.com/magiconair/properties/assert"
)
func TestSecretHashes_Equal(t *testing.T) {

View file

@ -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 (

View file

@ -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

View file

@ -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) {

View file

@ -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 (

View file

@ -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

View file

@ -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 (

View file

@ -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) {

View file

@ -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

View file

@ -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) {

View file

@ -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"
)

View file

@ -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) {

View file

@ -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

View file

@ -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 (

View file

@ -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

View file

@ -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

View file

@ -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 (

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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) {

View file

@ -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() {

View file

@ -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() {

View file

@ -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"

View file

@ -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) {

View file

@ -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 (

View file

@ -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 {

View file

@ -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 {

View file

@ -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"

View file

@ -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 {

View file

@ -27,6 +27,7 @@ import (
"github.com/arangodb/go-driver"
"github.com/arangodb/go-driver/agency"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
)

View file

@ -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.

View file

@ -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 (

View file

@ -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"

View file

@ -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"

Some files were not shown because too many files have changed in this diff Show more