Skip to content

Commit

Permalink
Ignore 64bit ARM when setting ETCD_UNSUPPORTED_ARCH (#519)
Browse files Browse the repository at this point in the history
* Ignore 64bit ARM when setting ETCD_UNSUPPORTED_ARCH

Signed-off-by: Kimmo Lehto <[email protected]>

* Add version switch

Signed-off-by: Kimmo Lehto <[email protected]>

---------

Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Aug 1, 2023
1 parent ee995eb commit 753d4c4
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion phase/arm_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package phase
import (
"strings"

"github.com/k0sproject/version"
log "github.com/sirupsen/logrus"

"github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1"
Expand All @@ -26,8 +27,34 @@ func (p *PrepareArm) Prepare(config *v1beta1.Cluster) error {
p.Config = config

p.hosts = p.Config.Spec.Hosts.Filter(func(h *cluster.Host) bool {
if h.Role == "worker" {
return false
}

arch := h.Metadata.Arch
return h.Role != "worker" && (strings.HasPrefix(arch, "arm") || strings.HasPrefix(arch, "aarch"))

if !strings.HasPrefix(arch, "arm") && !strings.HasPrefix(arch, "aarch") {
return false
}

if strings.HasSuffix(arch, "64") {
// 64-bit arm is supported on etcd 3.5.0+ which is included in k0s v1.22.1+k0s.0 and newer
minVer, err := version.NewVersion("v1.22.1+k0s.0")
if err != nil {
log.Warnf("failed to parse constraint k0s version: %v", err)
return false
}
k0sVer, err := version.NewVersion(p.Config.Spec.K0s.Version)
if err != nil {
log.Warnf("failed to parse target k0s version: %v", err)
return false
}
if k0sVer.GreaterThanOrEqual(minVer) {
return false
}
}

return true
})

return nil
Expand Down

0 comments on commit 753d4c4

Please sign in to comment.