diff --git a/cmd/kops/root.go b/cmd/kops/root.go index af3b792d40..7ade766833 100644 --- a/cmd/kops/root.go +++ b/cmd/kops/root.go @@ -126,9 +126,10 @@ func NewCmdRoot(f *util.Factory, out io.Writer) *cobra.Command { if strings.HasSuffix(defaultStateStore, "/") { defaultStateStore = strings.TrimSuffix(defaultStateStore, "/") } - cmd.PersistentFlags().StringVarP(&rootCommand.RegistryPath, "state", "", defaultStateStore, "Location of state storage") + cmd.PersistentFlags().StringVarP(&rootCommand.RegistryPath, "state", "", defaultStateStore, "Location of state storage. Overrides $KOPS_STATE_STORE") - cmd.PersistentFlags().StringVarP(&rootCommand.clusterName, "name", "", "", "Name of cluster") + defaultClusterName := os.Getenv("KOPS_CLUSTER_NAME") + cmd.PersistentFlags().StringVarP(&rootCommand.clusterName, "name", "", defaultClusterName, "Name of cluster. Overrides $KOPS_CLUSTER_NAME") // create subcommands cmd.AddCommand(NewCmdCompletion(f, out))