You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2019/11/25 15:35:18 UTC
[camel-k] 02/02: Use KUBECONF property in test
This is an automated email from the ASF dual-hosted git repository.
nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 7ff682fb7b118e667e413a225dd01d9647be5195
Author: Jan <jb...@redhat.com>
AuthorDate: Mon Nov 25 06:42:33 2019 +0100
Use KUBECONF property in test
---
e2e/test_support.go | 3 ++-
pkg/client/client.go | 3 ---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/e2e/test_support.go b/e2e/test_support.go
index f9a7e3b..1be93c3 100644
--- a/e2e/test_support.go
+++ b/e2e/test_support.go
@@ -41,6 +41,7 @@ import (
"github.com/google/uuid"
"github.com/onsi/gomega"
projectv1 "github.com/openshift/api/project/v1"
+ "github.com/operator-framework/operator-sdk/pkg/k8sutil"
"github.com/spf13/cobra"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
@@ -79,7 +80,7 @@ func init() {
}
func newTestClient() (client.Client, error) {
- return client.NewOutOfClusterClient("")
+ return client.NewOutOfClusterClient(os.Getenv(k8sutil.KubeConfigEnvVar))
}
func kamel(args ...string) *cobra.Command {
diff --git a/pkg/client/client.go b/pkg/client/client.go
index c72d803..55ddf41 100644
--- a/pkg/client/client.go
+++ b/pkg/client/client.go
@@ -164,9 +164,6 @@ func initialize(kubeconfig string) {
}
func getDefaultKubeConfigFile() (string, error) {
- if os.Getenv(k8sutil.KubeConfigEnvVar) != "" {
- return os.Getenv(k8sutil.KubeConfigEnvVar), nil
- }
usr, err := user.Current()
if err != nil {
return "", err