@@ -26,6 +26,7 @@ import (
26
26
"os/user"
27
27
"path/filepath"
28
28
"runtime"
29
+ "slices"
29
30
"strings"
30
31
"time"
31
32
@@ -43,6 +44,10 @@ const (
43
44
docURL = "https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/"
44
45
)
45
46
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
+
46
51
func init () {
47
52
if err := registry .Register (registry.DriverDef {
48
53
Name : driver .KVM2 ,
@@ -99,27 +104,16 @@ func defaultURI() string {
99
104
}
100
105
101
106
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 , "," )),
113
111
}
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"
122
115
}
116
+ return rs
123
117
}
124
118
125
119
// Allow no more than 6 seconds for querying state
0 commit comments