Set node name the same as host name by default for none driver
Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>pull/6200/head
parent
914c34cc2a
commit
73608d60e4
|
@ -889,6 +889,13 @@ func generateCfgFromFlags(cmd *cobra.Command, k8sVersion string, drvName string)
|
|||
}
|
||||
|
||||
kubeNodeName := viper.GetString(nodeName)
|
||||
if kubeNodeName == "" {
|
||||
if drvName == driver.None {
|
||||
// set the node name the same as host name for none driver
|
||||
hostname, _ := os.Hostname()
|
||||
kubeNodeName = hostname
|
||||
}
|
||||
|
||||
if kubeNodeName == "" {
|
||||
machineName := viper.GetString(cfg.MachineProfile)
|
||||
if machineName != constants.DefaultMachineName {
|
||||
|
@ -897,6 +904,7 @@ func generateCfgFromFlags(cmd *cobra.Command, k8sVersion string, drvName string)
|
|||
kubeNodeName = constants.DefaultNodeName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfg := cfg.MachineConfig{
|
||||
Name: viper.GetString(cfg.MachineProfile),
|
||||
|
|
Loading…
Reference in New Issue