Skip to content

Commit

Permalink
only print kubeconfig location after login for 1+ destinations
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorganca committed Aug 16, 2021
1 parent ea4bc08 commit e0543cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,10 @@ var loginCmd = &cobra.Command{
return err
}

kubeConfigPath := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}).ConfigAccess().GetDefaultFilename()
fmt.Println(blue("✓") + " Kubeconfig updated: " + termenv.String(strings.ReplaceAll(kubeConfigPath, home, "~")).Bold().String())
if len(destRes.Destinations) > 0 {
kubeConfigPath := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}).ConfigAccess().GetDefaultFilename()
fmt.Println(blue("✓") + " Kubeconfig updated: " + termenv.String(strings.ReplaceAll(kubeConfigPath, home, "~")).Bold().String())
}

context, err := switchToFirstInfraContext()
if err != nil {
Expand Down

0 comments on commit e0543cc

Please sign in to comment.