Skip to content

Commit

Permalink
Fix goimports violations
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark authored and bonifaido committed Jan 28, 2020
1 parent 10f7fbf commit 5d83e08
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 17 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ linters:
- lll

# TODO: fixme
- goimports
- gochecknoglobals
- gochecknoinits
- unparam
Expand Down
3 changes: 2 additions & 1 deletion cmd/bank-vaults/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package main

import (
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
)

const cfgInitRootToken = "init-root-token"
Expand Down
3 changes: 2 additions & 1 deletion cmd/bank-vaults/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
package main

import (
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"

"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
)

const prometheusNS = "vault"
Expand Down
3 changes: 2 additions & 1 deletion cmd/bank-vaults/unseal.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
"strings"
"time"

"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
)

const cfgUnsealPeriod = "unseal-period"
Expand Down
3 changes: 2 additions & 1 deletion cmd/bank-vaults/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ package main
import (
"fmt"

"github.com/spf13/viper"

"github.com/banzaicloud/bank-vaults/pkg/kv"
"github.com/banzaicloud/bank-vaults/pkg/kv/alibabakms"
"github.com/banzaicloud/bank-vaults/pkg/kv/alibabaoss"
Expand All @@ -31,7 +33,6 @@ import (
"github.com/banzaicloud/bank-vaults/pkg/kv/s3"
kvvault "github.com/banzaicloud/bank-vaults/pkg/kv/vault"
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
"github.com/spf13/viper"
)

func vaultConfigForConfig(cfg *viper.Viper) (vault.Config, error) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/template/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"os"
"strings"

"github.com/banzaicloud/bank-vaults/internal/configuration"
log "github.com/sirupsen/logrus"

"github.com/banzaicloud/bank-vaults/internal/configuration"
)

type arrayFlags []string
Expand Down
3 changes: 2 additions & 1 deletion cmd/vault-secrets-webhook/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
"fmt"
"strings"

corev1 "k8s.io/api/core/v1"

internal "github.com/banzaicloud/bank-vaults/internal/configuration"
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
corev1 "k8s.io/api/core/v1"
)

func configMapNeedsMutation(configMap *corev1.ConfigMap) bool {
Expand Down
5 changes: 3 additions & 2 deletions cmd/vault-secrets-webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import (

internal "github.com/banzaicloud/bank-vaults/internal/configuration"

"github.com/banzaicloud/bank-vaults/cmd/vault-secrets-webhook/registry"
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
vaultapi "github.com/hashicorp/vault/api"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand All @@ -42,6 +40,9 @@ import (
kubeVer "k8s.io/apimachinery/pkg/version"
"k8s.io/client-go/kubernetes"
kubernetesConfig "sigs.k8s.io/controller-runtime/pkg/client/config"

"github.com/banzaicloud/bank-vaults/cmd/vault-secrets-webhook/registry"
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
)

var vaultAgentConfig = `
Expand Down
3 changes: 2 additions & 1 deletion cmd/vault-secrets-webhook/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"k8s.io/client-go/kubernetes"
fake "k8s.io/client-go/kubernetes/fake"

imagev1 "github.com/opencontainers/image-spec/specs-go/v1"

"github.com/banzaicloud/bank-vaults/cmd/vault-secrets-webhook/registry"
internal "github.com/banzaicloud/bank-vaults/internal/configuration"
imagev1 "github.com/opencontainers/image-spec/specs-go/v1"
)

var vaultConfig = internal.VaultConfig{
Expand Down
7 changes: 4 additions & 3 deletions cmd/vault-secrets-webhook/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ import (
"fmt"
"strings"

"github.com/banzaicloud/bank-vaults/cmd/vault-secrets-webhook/registry"
internal "github.com/banzaicloud/bank-vaults/internal/configuration"
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
dockerTypes "github.com/docker/docker/api/types"
"github.com/spf13/cast"
corev1 "k8s.io/api/core/v1"

"github.com/banzaicloud/bank-vaults/cmd/vault-secrets-webhook/registry"
internal "github.com/banzaicloud/bank-vaults/internal/configuration"
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
)

func secretNeedsMutation(secret *corev1.Secret) bool {
Expand Down
1 change: 1 addition & 0 deletions pkg/kv/alibabakms/kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package alibabakms
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/services/kms"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/kv/alibabaoss/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"io/ioutil"

"github.com/aliyun/aliyun-oss-go-sdk/oss"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/kv/awskms/awskms.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/kms"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/kv/azurekv/keyvault.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/kv/gckms/cloudkms.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
"encoding/base64"
"fmt"

"github.com/banzaicloud/bank-vaults/pkg/kv"
"golang.org/x/oauth2/google"
cloudkms "google.golang.org/api/cloudkms/v1"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

// googleKms is an implementation of the kv.Service interface, that encrypts
Expand Down
1 change: 1 addition & 0 deletions pkg/kv/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"io/ioutil"

"cloud.google.com/go/storage"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/kv/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ import (
"fmt"
"os"

"github.com/banzaicloud/bank-vaults/pkg/kv"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

// EnvK8SOwnerReference holds the environment variable name for passing in K8S owner refs
Expand Down
3 changes: 2 additions & 1 deletion pkg/kv/multi/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ package multi

import (
"emperror.dev/errors"
"github.com/banzaicloud/bank-vaults/pkg/kv"
"github.com/sirupsen/logrus"

"github.com/banzaicloud/bank-vaults/pkg/kv"
)

type multi struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/kv/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import (
"encoding/base64"
"fmt"

"github.com/spf13/cast"

"github.com/banzaicloud/bank-vaults/pkg/kv"
"github.com/banzaicloud/bank-vaults/pkg/sdk/vault"
"github.com/spf13/cast"
)

type VaultStorage struct {
Expand Down

0 comments on commit 5d83e08

Please sign in to comment.