From 929602e5d57527e1bdf39d607555e3d031f2cf5e Mon Sep 17 00:00:00 2001 From: Kimmo Lehto Date: Mon, 20 Jan 2025 15:07:53 +0200 Subject: [PATCH] Use cluster.StorageType() for ValidateEtcdMembers phase (#823) Signed-off-by: Kimmo Lehto --- phase/validate_etcd_members.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/phase/validate_etcd_members.go b/phase/validate_etcd_members.go index 06a56148..d8baaf8d 100644 --- a/phase/validate_etcd_members.go +++ b/phase/validate_etcd_members.go @@ -42,13 +42,10 @@ func (p *ValidateEtcdMembers) ShouldRun() bool { return false } - if len(p.Config.Spec.K0s.Config) > 0 { - storageType := p.Config.Spec.K0s.Config.DigString("spec", "storage", "type") - if storageType != "" && storageType != "etcd" { - log.Debugf("%s: storage type is %q, not k0s managed etcd", p.Config.Spec.K0sLeader(), storageType) - return false - } + if s := p.Config.StorageType(); s != "etcd" { + log.Debugf("%s: storage type is %q, not k0s managed etcd", p.Config.Spec.K0sLeader(), s) } + return len(p.hosts) > 0 }