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

Warn if KOPS_ARCH is not a recognized value #12194

Merged
merged 1 commit into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions util/pkg/architectures/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions util/pkg/architectures/architectures.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"fmt"
"os"
"runtime"

"k8s.io/klog/v2"
)

type Architecture string
Expand All @@ -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")
switch arch {
case "amd64":
return []Architecture{ArchitectureAmd64}
case "arm64":
return []Architecture{ArchitectureArm64}
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{
Expand Down