Skip to content

Commit

Permalink
for k3s set KUBECONFIG env var
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jul 20, 2018
1 parent d656cfe commit b24207b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions k8s/k3s.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package k8s
import (
"context"
"fmt"
"os"

"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
Expand All @@ -22,6 +23,7 @@ func getEmbedded(ctx context.Context) (bool, context.Context, *rest.Config, erro
return false, ctx, nil, err
}

os.Setenv("KUBECONFIG", sc.KubeConfig)
restConfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
&clientcmd.ClientConfigLoadingRules{ExplicitPath: sc.KubeConfig}, &clientcmd.ConfigOverrides{}).ClientConfig()

Expand Down

0 comments on commit b24207b

Please sign in to comment.