From be77ce891669a63a992f3d60ee0e7ea88f28a579 Mon Sep 17 00:00:00 2001 From: Jason-ZW Date: Sun, 28 Apr 2024 09:29:05 +0800 Subject: [PATCH] fix(k3d): fix HA mode pre-check error --- pkg/cluster/base.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/base.go b/pkg/cluster/base.go index 9cadaf11..22e0674c 100644 --- a/pkg/cluster/base.go +++ b/pkg/cluster/base.go @@ -692,11 +692,11 @@ func (p *ProviderBase) CheckCreateArgs(checkClusterExist func() (bool, []string, return fmt.Errorf("[%s] calling preflight error: `--master` number must >= 1", p.Provider) } - if masterNum > 1 && !p.Cluster && p.DataStore == "" { + if p.Provider != "k3d" && masterNum > 1 && !p.Cluster && p.DataStore == "" { return fmt.Errorf("[%s] calling preflight error: need to set `--cluster` or `--datastore` when `--master` number > 1", p.Provider) } - if strings.Contains(p.MasterExtraArgs, "--datastore-endpoint") && p.DataStore != "" { + if p.Provider != "k3d" && strings.Contains(p.MasterExtraArgs, "--datastore-endpoint") && p.DataStore != "" { return fmt.Errorf("[%s] calling preflight error: `--masterExtraArgs='--datastore-endpoint'` is duplicated with `--datastore`", p.Provider) }