Skip to content

Commit

Permalink
Renaming kube-config env var.
Browse files Browse the repository at this point in the history
  • Loading branch information
Otávio Fernandes committed Apr 13, 2019
1 parent 085687b commit 371ad72
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_script:
script:
- export VAULT_HANDLER_VAULT_ROLE_ID=$(grep ROLE_ID .env |awk -F '"' '{print $2}')
- export VAULT_HANDLER_VAULT_SECRET_ID=$(grep SECRET_ID .env |awk -F '"' '{print $2}')
- export KUBE_CONFIG="$(kind get kubeconfig-path --name="kind")"
- export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
- make bootstrap
- make
- make test
Expand Down
2 changes: 1 addition & 1 deletion pkg/vault-handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestHandlerAuthenticateAppRole(t *testing.T) {
VaultSecretID: os.Getenv("VAULT_HANDLER_VAULT_SECRET_ID"),
InputDir: inputDir,
OutputDir: outputDir,
KubeConfig: os.Getenv("KUBE_CONFIG"),
KubeConfig: os.Getenv("KUBECONFIG"),
Namespace: "default",
}
err = config.Validate()
Expand Down
5 changes: 3 additions & 2 deletions pkg/vault-handler/kubernetes_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package vaulthandler

import (
"github.com/stretchr/testify/assert"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

var kube *Kubernetes

func TestKubernetesNew(t *testing.T) {
var err error

kubeConfig := os.Getenv("KUBE_CONFIG")
kubeConfig := os.Getenv("KUBECONFIG")
t.Logf("Test kube-config: '%s'", kubeConfig)
kube, err = NewKubernetes(kubeConfig, "", "default", false)

Expand Down
5 changes: 3 additions & 2 deletions test/e2e/vault_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"os"
"testing"

vh "github.com/otaviof/vault-handler/pkg/vault-handler"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"

vh "github.com/otaviof/vault-handler/pkg/vault-handler"
)

var manifestFiles = []string{"../mock/manifest-1.yaml", "../mock/manifest-2.yaml"}
Expand All @@ -19,7 +20,7 @@ var config = &vh.Config{
OutputDir: "/tmp",
VaultRoleID: os.Getenv("VAULT_HANDLER_VAULT_ROLE_ID"),
VaultSecretID: os.Getenv("VAULT_HANDLER_VAULT_SECRET_ID"),
KubeConfig: os.Getenv("KUBE_CONFIG"),
KubeConfig: os.Getenv("KUBECONFIG"),
Context: "",
Namespace: "default",
InCluster: false,
Expand Down

0 comments on commit 371ad72

Please sign in to comment.