Skip to content

Commit 9a86213

Browse files
committed
fixup: Improve status check
1 parent 2da4765 commit 9a86213

File tree

1 file changed

+13
-19
lines changed
  • pkg/minikube/registry/drvs/kvm2

1 file changed

+13
-19
lines changed

pkg/minikube/registry/drvs/kvm2/kvm2.go

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"os/user"
2727
"path/filepath"
2828
"runtime"
29+
"slices"
2930
"strings"
3031
"time"
3132

@@ -43,6 +44,10 @@ const (
4344
docURL = "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/"
4445
)
4546

47+
// The driver is implemented for amd64 and arm64, but we cannot build the arm64
48+
// version yet: https://github.com/kubernetes/minikube/issues/19959.
49+
var supportedArchictures = []string{"amd64"}
50+
4651
func init() {
4752
if err := registry.Register(registry.DriverDef{
4853
Name: driver.KVM2,
@@ -99,27 +104,16 @@ func defaultURI() string {
99104
}
100105

101106
func status() registry.State {
102-
// Only amd64 and arm64 are implemented, but we canot build for arm64 yet
103-
// due to CGO cross compile issue. We hope to fix the arm64 issue, but other
104-
// architecture may never be supported.
105-
106-
if runtime.GOARCH == "arm64" {
107-
return registry.State{
108-
Installed: false,
109-
Running: false,
110-
Error: fmt.Errorf("KVM is not supported on arm64 due to build issue, contributions are welcome"),
111-
Fix: "follow the github issue for possible fix",
112-
Doc: "https://github.com/kubernetes/minikube/issues/19959",
107+
if !slices.Contains(supportedArchictures, runtime.GOARCH) {
108+
rs := registry.State{
109+
Error: fmt.Errorf("KVM is not supported on %q, contributions are welcome", runtime.GOARCH),
110+
Fix: fmt.Sprintf("you can use the KVM driver on %s", strings.Join(supportedArchictures, ",")),
113111
}
114-
}
115-
116-
if runtime.GOARCH != "amd64" {
117-
return registry.State{
118-
Installed: false,
119-
Running: false,
120-
Error: fmt.Errorf("KVM is not supported for %q, contributions are welcome", runtime.GOARCH),
121-
Fix: "use this driver on amd64 machine",
112+
// The driver is implemented but we cannot build it yet.
113+
if runtime.GOARCH == "arm64" {
114+
rs.Doc = "https://github.com/kubernetes/minikube/issues/19959"
122115
}
116+
return rs
123117
}
124118

125119
// Allow no more than 6 seconds for querying state

0 commit comments

Comments
 (0)