mirror of https://github.com/kubernetes/kops.git
Merge pull request #12194 from justinsb/warn_if_unknown_arch
Warn if KOPS_ARCH is not a recognized value
This commit is contained in:
commit
11af87bf4e
|
|
@ -5,4 +5,5 @@ go_library(
|
|||
srcs = ["architectures.go"],
|
||||
importpath = "k8s.io/kops/util/pkg/architectures",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//vendor/k8s.io/klog/v2:go_default_library"],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
type Architecture string
|
||||
|
|
@ -44,11 +46,15 @@ func GetSupported() []Architecture {
|
|||
// Kubernetes PR builds only generate AMD64 binaries at the moment
|
||||
// Force support only for AMD64 or ARM64
|
||||
arch := os.Getenv("KOPS_ARCH")
|
||||
if arch != "" {
|
||||
switch arch {
|
||||
case "amd64":
|
||||
return []Architecture{ArchitectureAmd64}
|
||||
case "arm64":
|
||||
return []Architecture{ArchitectureArm64}
|
||||
default:
|
||||
klog.Warningf("unknown architecture KOPS_ARCH=%q", arch)
|
||||
}
|
||||
}
|
||||
|
||||
return []Architecture{
|
||||
|
|
|
|||
Loading…
Reference in New Issue