From 01dd61a97bddd84cf3df9ad495164359da92cb8d Mon Sep 17 00:00:00 2001 From: Jason-ZW Date: Tue, 22 Sep 2020 10:04:51 +0800 Subject: [PATCH] fix(autok3s): fix --datastore assignment logic Signed-off-by: Jason-ZW --- pkg/cluster/cluster.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 70d01291..5f896d20 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -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 } @@ -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 }