Permalink
Browse files

for k3s set KUBECONFIG env var

  • Loading branch information...
ibuildthecloud committed Jul 13, 2018
1 parent d656cfe commit b24207b319bdaff6c184483e867c62ad927a389a
Showing with 2 additions and 0 deletions.
  1. +2 −0 k8s/k3s.go
View
@@ -5,6 +5,7 @@ package k8s
import (
"context"
"fmt"
"os"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
@@ -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()

0 comments on commit b24207b

Please sign in to comment.