Skip to content

Commit

Permalink
fix(autok3s): fix --datastore assignment logic
Browse files Browse the repository at this point in the history
Signed-off-by: Jason-ZW <zhenyang@rancher.com>
  • Loading branch information
rancher-sy-bot committed Sep 25, 2020
1 parent 33ad1f3 commit 01dd61a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func InitK3sCluster(cluster *types.Cluster) error {
masterExtraArgs := cluster.MasterExtraArgs
workerExtraArgs := cluster.WorkerExtraArgs

if len(cluster.MasterNodes) > 1 {
if len(cluster.MasterNodes) > 1 || cluster.DataStore != "" {
masterExtraArgs += "--datastore-endpoint " + cluster.DataStore
}

Expand Down Expand Up @@ -269,7 +269,7 @@ func JoinK3sNode(merged, added *types.Cluster) error {
if added.Status.MasterNodes[i].InstanceID == full.InstanceID {
logrus.Infof("[%s] joining k3s %dth master...\n", merged.Provider, i+1)

if len(added.MasterNodes) >= 1 {
if len(added.MasterNodes) >= 1 || merged.DataStore != "" {
extraArgs += "server --datastore-endpoint " + merged.DataStore
}

Expand Down

0 comments on commit 01dd61a

Please # to comment.