Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-and-remove-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
matthisholleville committed Mar 31, 2023
2 parents 32ddf66 + 9e9cd70 commit 9ebb7de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
File renamed without changes.
18 changes: 9 additions & 9 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ func init() {
// when this action is called directly.
// rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")

//Initialise the kubeconfig
kubernetesClient, err := kubernetes.NewClient(kubecontext, kubeconfig)
if err != nil {
color.Red("Error initialising kubernetes client: %v", err)
os.Exit(1)
}

viper.Set("kubernetesClient", kubernetesClient)

}

// initConfig reads in config file and ENV variables if set.
Expand All @@ -90,6 +81,15 @@ func initConfig() {
viper.SafeWriteConfig()
}

//Initialise the kubeconfig
kubernetesClient, err := kubernetes.NewClient(kubecontext, kubeconfig)
if err != nil {
color.Red("Error initialising kubernetes client: %v", err)
os.Exit(1)
}

viper.Set("kubernetesClient", kubernetesClient)

viper.AutomaticEnv() // read in environment variables that match

// If a config file is found, read it in.
Expand Down

0 comments on commit 9ebb7de

Please sign in to comment.