Skip to content

Commit

Permalink
🐻‍❄️ update kubeconfig load options
Browse files Browse the repository at this point in the history
  • Loading branch information
zcubbs committed Oct 1, 2023
1 parent 64564cb commit f7a2030
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/awx/awx.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type OperatorConfig struct {
HelmRepoURL string `mapstructure:"helm_repo_url" json:"helm_repo_url"`
HelmRepoName string `mapstructure:"helm_repo_name" json:"helm_repo_name"`
HelmChartName string `mapstructure:"helm_chart_name" json:"helm_chart_name"`
HelmRelease string `mapstructure:"helm_release" json:"helm_release"`
HelmRelease string `mapstructure:"helm_release_name" json:"helm_release_name"`
}

type InstanceConfig struct {
Expand Down
11 changes: 11 additions & 0 deletions cmd/awx/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ func getKubeConfig(path string, debug bool) (string, error) {
return kc, nil
}

kc = "/etc/rancher/k3s/k3s.yaml"
fi, err = os.Stat(kc)
os.IsNotExist(err)
if err != nil && debug {
fmt.Printf("kubeconfig not found in default location %s\n", kc)
}

if fi != nil {
return kc, nil
}

kc = os.Getenv("KUBECONFIG")
if kc == "" {
return "", fmt.Errorf("kubeconfig not found")
Expand Down

0 comments on commit f7a2030

Please sign in to comment.