Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore 64bit ARM when setting ETCD_UNSUPPORTED_ARCH #519

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading