diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index a5861670..9d41eef3 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -88,7 +88,7 @@ func InitK3sCluster(cluster *types.Cluster) error { } for _, master := range cluster.MasterNodes { - if strings.Contains(masterExtraArgs, "--docker") { + if strings.Contains(masterExtraArgs, "--docker" ) { if _, err := execute(&hosts.Host{Node: master}, fmt.Sprintf(dockerCommand, dockerMirror), false); err != nil { return err @@ -121,16 +121,6 @@ func InitK3sCluster(cluster *types.Cluster) error { return err } - // merge current cluster to kube config. - if err := saveCfg(cfg, publicIP, cluster.Name); err != nil { - return err - } - - // write current cluster to state file. - if err := saveState(cluster); err != nil { - return err - } - // deploy additional Terway manifests. if terway != nil { tmpl := fmt.Sprintf(terwayTmpl, terway.AccessKey, terway.AccessSecret, terway.SecurityGroup, terway.CIDR, terway.VSwitches, terway.MaxPoolSize) @@ -154,6 +144,16 @@ func InitK3sCluster(cluster *types.Cluster) error { } } + // merge current cluster to kube config. + if err := saveCfg(cfg, publicIP, cluster.Name); err != nil { + return err + } + + // write current cluster to state file. + if err := saveState(cluster); err != nil { + return err + } + return nil }