Skip to content

Commit 3496901

Browse files
authored
vfkit: Change priority to Preferred (#20808)
vfkit is using the native virtualization framework, provides good best performance and all the features needed by minikube. It is also well maintained and used by other projects like podman. This fixes the automatic driver selection. When we start minikube on a system with both vfkit and qemu, vfkit is selected: % minikube start 😄 minikube v1.35.0 on Darwin 15.5 (arm64) ✨ Automatically selected the vfkit driver. Other choices: qemu2, ssh, podman (experimental) 👍 Starting "minikube" primary control-plane node in "minikube" cluster 🔥 Creating vfkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ... 🐳 Preparing Kubernetes v1.33.1 on Docker 28.0.4 ... ▪ Generating certificates and keys ... ▪ Booting up control plane ... ▪ Configuring RBAC rules ... 🔗 Configuring bridge CNI (Container Networking Interface) ... 🔎 Verifying Kubernetes components... ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5 🌟 Enabled addons: default-storageclass, storage-provisioner 🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
1 parent 42fa39b commit 3496901

File tree

1 file changed

+7
-2
lines changed
  • pkg/minikube/registry/drvs/vfkit

1 file changed

+7
-2
lines changed

pkg/minikube/registry/drvs/vfkit/vfkit.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fmt"
2424
"os/exec"
2525
"path/filepath"
26+
"runtime"
2627

2728
"github.com/docker/machine/libmachine/drivers"
2829
"github.com/google/uuid"
@@ -41,13 +42,17 @@ const (
4142
)
4243

4344
func init() {
45+
priority := registry.Unknown
46+
if runtime.GOOS == "darwin" {
47+
priority = registry.Preferred
48+
}
4449
if err := registry.Register(registry.DriverDef{
4550
Name: driver.VFKit,
4651
Init: func() drivers.Driver { return vfkit.NewDriver("", "") },
4752
Config: configure,
4853
Status: status,
4954
Default: true,
50-
Priority: registry.Experimental,
55+
Priority: priority,
5156
}); err != nil {
5257
panic(fmt.Sprintf("register failed: %v", err))
5358
}
@@ -104,7 +109,7 @@ func configure(cfg config.ClusterConfig, n config.Node) (interface{}, error) {
104109
func status() registry.State {
105110
_, err := exec.LookPath("vfkit")
106111
if err != nil {
107-
return registry.State{Error: err, Fix: "Run 'brew tap cfergeau/crc && brew install vfkit'", Doc: docURL}
112+
return registry.State{Error: err, Fix: "Run 'brew install vfkit'", Doc: docURL}
108113
}
109114
return registry.State{Installed: true, Healthy: true, Running: true}
110115
}

0 commit comments

Comments
 (0)