mirror of https://github.com/kubernetes/kops.git
Add cluster name environment variable
- Add an environment variable to configure cluster name - Expose envionrment variable in CLI documentation
This commit is contained in:
parent
db01b6a01f
commit
3b9384a23c
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue