提交 fa97a5bf 编写于 作者: S Sharif Elgamal

fix machine name creation

上级 efac79eb
......@@ -234,14 +234,13 @@ func MachineName(cc config.ClusterConfig, n config.Node) string {
if len(cc.Nodes) == 1 || n.ControlPlane {
return cc.Name
}
return fmt.Sprintf("%s-%s", cc.Name, n.Name)
return fmt.Sprintf("%s---%s", cc.Name, n.Name)
}
// ClusterNameFromMachine retrieves the cluster name embedded in the machine name
func ClusterNameFromMachine(name string) string {
if strings.Contains(name, "-") {
a := strings.Split(name, "-")
return strings.Join(a[0:len(a)-2], "-")
if strings.Contains(name, "---") {
return strings.Split(name, "---")[0]
}
return name
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册