look for kubeconfig value in config file if not set on command line
@@ -86,12 +86,16 @@ func initConfig() {
fmt.Println(err.Error())
}
+ if KubeconfigPath == "" {
+ KubeconfigPath = viper.GetString("kubeconfig")
+ }
if KubeconfigPath == "" {
fmt.Println("--kubeconfig flag is not set and required")
- panic("--kubeconfig flag required")
+ os.Exit(2)
}
- fmt.Println("viper value is " + viper.GetString("cluster.clusterthing"))
+ fmt.Println("viper kubeconfig value is " + viper.GetString("kubeconfig"))
+ fmt.Println("viper CCP_IMAGE_TAG value is " + viper.GetString("cluster.CCP_IMAGE_TAG"))
//fmt.Println(" root initConfig called")
ConnectToKube()
