Skip to content

Commit

Permalink
If set, use $KUBECONFIG when creating a new client (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
yankcrime authored and alenkacz committed Jul 1, 2019
1 parent 8646b6a commit 42a6299
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/kudoctl/cmd/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ type Options struct {
AllDependencies bool
AutoApprove bool
InstanceName string
KubeConfigPath string
Namespace string
Parameters map[string]string
PackageVersion string
KubeConfigPath string
SkipInstance bool
}

Expand All @@ -40,6 +40,11 @@ func Run(cmd *cobra.Command, args []string, options *Options) error {
return fmt.Errorf("get flag: %+v", err)
}

// If the $KUBECONFIG environment variable is set, use that
if len(os.Getenv("KUBECONFIG")) > 0 {
options.KubeConfigPath = os.Getenv("KUBECONFIG")
}

configPath, err := check.KubeConfigLocationOrDefault(options.KubeConfigPath)
if err != nil {
return fmt.Errorf("error when getting default kubeconfig path: %+v", err)
Expand Down

0 comments on commit 42a6299

Please sign in to comment.