{"record":{"id":"4a3185cd3e2f3ade","repo":"kubernetes/kops","slug":"unsupported-arch-q","errorCode":null,"errorMessage":"unsupported arch: %q","messagePattern":"unsupported arch: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/architectures/architectures.go","lineNumber":47,"sourceCode":"const (\n\tArchitectureAmd64 Architecture = \"amd64\"\n\tArchitectureArm64 Architecture = \"arm64\"\n)\n\ntype GPUVendor string\n\nconst (\n\tGPUVendorNvidia GPUVendor = \"nvidia\"\n)\n\nfunc FindArchitecture() (Architecture, error) {\n\tswitch runtime.GOARCH {\n\tcase \"amd64\":\n\t\treturn ArchitectureAmd64, nil\n\tcase \"arm64\":\n\t\treturn ArchitectureArm64, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported arch: %q\", runtime.GOARCH)\n\t}\n}\n\nfunc GetSupported() []Architecture {\n\t// Kubernetes PR builds only generate AMD64 binaries at the moment\n\t// Force support only for AMD64 or ARM64\n\tarch := os.Getenv(\"KOPS_ARCH\")\n\tif arch != \"\" {\n\t\tswitch arch {\n\t\tcase \"amd64\":\n\t\t\treturn []Architecture{ArchitectureAmd64}\n\t\tcase \"arm64\":\n\t\t\treturn []Architecture{ArchitectureArm64}\n\t\tdefault:\n\t\t\tklog.Warningf(\"unknown architecture KOPS_ARCH=%q\", arch)\n\t\t}\n\t}\n","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/architectures/architectures.go#L29-L65","documentation":"FindArchitecture in util/pkg/architectures maps the Go runtime's runtime.GOARCH to kOps' internal Architecture type, which only supports amd64 and arm64. If the kOps binary was compiled for any other CPU architecture (e.g. 386, arm, ppc64le, s390x, riscv64), the function cannot return a valid Architecture and throws this error. It signals that the binary itself was built for a platform kOps does not target.","triggerScenarios":"Calling architectures.FindArchitecture() from a kOps binary compiled with GOARCH set to anything other than amd64 or arm64 — e.g. running `GOARCH=386 go build` output on an i386 host, or building for arm/armhf/ppc64le. It is reached via Run in the CLI before any cluster work begins.","commonSituations":"Running kOps on old 32-bit hosts or embedded boards; a Makefile or CI job cross-compiling with an unintended GOARCH; distro-packaged kOps built for secondary architectures (ppc64le, s390x) that upstream never supported; using `go install` on a machine whose native arch is unsupported.","solutions":["Rebuild or download kOps for a supported architecture: use the official amd64 or arm64 release binaries","If the host truly has an unsupported CPU, run kOps remotely (e.g. from a laptop or CI amd64 runner) against the cluster instead of on the node itself","If cross-compiling, explicitly set GOARCH=amd64 (or arm64) in your build command/Makefile","Check the binary with `go version -m $(which kops)` to see the GOARCH it was built for"],"exampleFix":"// before (cross-compiling in CI)\ngoos=linux goarch=386 go build -o kops .\n// after\ngoos=linux goarch=amd64 go build -o kops .","handlingStrategy":"validation","validationCode":"supported := architectures.GetSupported() // honors KOPS_ARCH\n// before calling FindArchitecture, check the binary's own arch:\nif runtime.GOARCH != \"amd64\" && runtime.GOARCH != \"arm64\" {\n    return fmt.Errorf(\"this host arch %s is not supported; build kOps for amd64/arm64\", runtime.GOARCH)\n}","typeGuard":"func isSupportedArch(a string) bool {\n    return a == \"amd64\" || a == \"arm64\"\n}","tryCatchPattern":"arch, err := architectures.FindArchitecture()\nif err != nil {\n    klog.Fatalf(\"cannot run kOps on this platform: %v (supported: %v)\", err, architectures.GetSupported())\n}","preventionTips":["Download official release binaries for amd64/arm64 instead of building for exotic GOARCH targets","Pin GOARCH explicitly in CI/Makefiles so cross-compilation cannot silently pick an unsupported arch","Check `go version -m kops` to verify build arch when distributing binaries","Run kOps from an amd64/arm64 control machine against remote clusters rather than on the node itself"],"tags":["architecture","platform-support","go-runtime"],"backgroundTag":"unsupported-cpu-architecture","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}