Skip to content

Commit c2a5360

Browse files
authored
Merge pull request #16233 from spowelljr/fixISOAndVMware
Mark VMware driver as unsupported
2 parents e5f5d7a + 15b0ad0 commit c2a5360

File tree

15 files changed

+44
-9
lines changed

15 files changed

+44
-9
lines changed

cmd/minikube/cmd/start.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ func provisionWithDriver(cmd *cobra.Command, ds registry.DriverState, existing *
300300
}
301301

302302
virtualBoxMacOS13PlusWarning(driverName)
303+
vmwareUnsupported(driverName)
303304
validateFlags(cmd, driverName)
304305
validateUser(driverName)
305306
if driverName == oci.Docker {
@@ -374,23 +375,33 @@ func provisionWithDriver(cmd *cobra.Command, ds registry.DriverState, existing *
374375
}
375376

376377
func virtualBoxMacOS13PlusWarning(driverName string) {
377-
if driverName != "virtualbox" || !detect.MacOS13Plus() {
378+
if !driver.IsVirtualBox(driverName) || !detect.MacOS13Plus() {
378379
return
379380
}
380-
driver := "hyperkit"
381+
suggestedDriver := driver.HyperKit
381382
if runtime.GOARCH == "arm64" {
382-
driver = "qemu"
383+
suggestedDriver = driver.QEMU
383384
}
384385
out.WarningT(`Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. You can use alternative drivers such as docker or {{.driver}}.
385386
https://minikube.sigs.k8s.io/docs/drivers/docker/
386387
https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}/
387388
388389
For more details on the issue see: https://github.com/kubernetes/minikube/issues/15274
389-
`, out.V{"driver": driver})
390+
`, out.V{"driver": suggestedDriver})
391+
}
392+
393+
func vmwareUnsupported(driverName string) {
394+
if !driver.IsVMware(driverName) {
395+
return
396+
}
397+
exit.Message(reason.DrvUnsupported, `Due to security improvements to minikube the VMware driver is currently not supported. Available workarounds are to use a different driver or downgrade minikube to v1.29.0.
398+
399+
We are accepting community contributions to fix this, for more details on the issue see: https://github.com/kubernetes/minikube/issues/16221
400+
`)
390401
}
391402

392403
func validateBuiltImageVersion(r command.Runner, driverName string) {
393-
if driverName == driver.None {
404+
if driver.IsNone(driverName) {
394405
return
395406
}
396407
res, err := r.RunCmd(exec.Command("cat", "/version.json"))
@@ -1459,7 +1470,7 @@ func noLimitMemory(sysLimit, containerLimit int, drvName string) int {
14591470
}
14601471
// Recommend 1GB to handle OS/VM overhead
14611472
sysOverhead := 1024
1462-
if drvName == "virtualbox" {
1473+
if driver.IsVirtualBox(drvName) {
14631474
// VirtualBox fully allocates all requested memory on start, it doesn't dynamically allocate when needed like other drivers
14641475
// Because of this allow more system overhead to prevent out of memory issues
14651476
sysOverhead = 1536

pkg/minikube/driver/driver.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ func IsSSH(name string) bool {
190190
return name == SSH
191191
}
192192

193+
// IsVirtualBox checks if the driver is VirtualBox
194+
func IsVirtualBox(name string) bool {
195+
return name == VirtualBox
196+
}
197+
198+
// IsVMware checks if the driver is VMware
199+
func IsVMware(name string) bool {
200+
return name == VMware
201+
}
202+
193203
// AllowsPreload returns if preload is allowed for the driver
194204
func AllowsPreload(driverName string) bool {
195205
return !BareMetal(driverName) && !IsSSH(driverName)

pkg/minikube/node/start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ func addCoreDNSEntry(runner command.Runner, name, ip string, cc config.ClusterCo
922922
func warnVirtualBox() {
923923
var altDriverList strings.Builder
924924
for _, choice := range driver.Choices(true) {
925-
if choice.Name != "virtualbox" && choice.Priority != registry.Discouraged && choice.State.Installed && choice.State.Healthy {
925+
if !driver.IsVirtualBox(choice.Name) && choice.Priority != registry.Discouraged && choice.State.Installed && choice.State.Healthy {
926926
altDriverList.WriteString(fmt.Sprintf("\n\t- %s", choice.Name))
927927
}
928928
}

pkg/minikube/reason/reason.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ var (
286286
}
287287
// minikube failed to bind container ports to host ports
288288
DrvPortForward = Kind{ID: "DRV_PORT_FORWARD", ExitCode: ExDriverError}
289+
// the driver is currently not supported by minikube
290+
DrvUnsupported = Kind{ID: "DRV_UNSUPPORTED", ExitCode: ExDriverUnsupported}
289291
// the driver in use does not support multi-node clusters
290292
DrvUnsupportedMulti = Kind{ID: "DRV_UNSUPPORTED_MULTINODE", ExitCode: ExDriverConflict}
291293
// the specified driver is not supported on the host OS

pkg/minikube/registry/drvs/vmware/vmware.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func init() {
3232
err := registry.Register(registry.DriverDef{
3333
Name: driver.VMware,
3434
Config: configure,
35-
Default: true,
36-
Priority: registry.Default,
35+
Default: false,
36+
Priority: registry.Deprecated,
3737
Status: status,
3838
})
3939
if err != nil {

site/content/en/docs/contrib/errorcodes.en.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ minikube failed to access the driver control plane or API endpoint
223223
"DRV_PORT_FORWARD" (Exit code ExDriverError)
224224
minikube failed to bind container ports to host ports
225225

226+
"DRV_UNSUPPORTED" (Exit code ExDriverUnsupported)
227+
the driver is currently not supported by minikube
228+
226229
"DRV_UNSUPPORTED_MULTINODE" (Exit code ExDriverConflict)
227230
the driver in use does not support multi-node clusters
228231

translations/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
"Downloading driver {{.driver}}:": "Lade Treiber {{.driver}} herunter:",
182182
"Due to DNS issues your cluster may have problems starting and you may not be able to pull images\nMore details available at: https://minikube.sigs.k8s.io/docs/drivers/qemu/#known-issues": "",
183183
"Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. You can use alternative drivers such as docker or {{.driver}}.\n https://minikube.sigs.k8s.io/docs/drivers/docker/\n https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}/\n\n For more details on the issue see: https://github.com/kubernetes/minikube/issues/15274\n": "",
184+
"Due to security improvements to minikube the VMware driver is currently not supported. Available workarounds are to use a different driver or downgrade minikube to v1.29.0.\n\n We are accepting community contributions to fix this, for more details on the issue see: https://github.com/kubernetes/minikube/issues/16221\n": "",
184185
"Duration until minikube certificate expiration, defaults to three years (26280h).": "Dauer bis das Minikube-Zertifikat abläuft, Default ist drei Jahre (26280 Stunden).",
185186
"ERROR creating `registry-creds-acr` secret": "Fehler beim Erstellen des `registry-creds-acr` Secrets",
186187
"ERROR creating `registry-creds-dpr` secret": "Fehler beim Erstellen des `registry-creds-dpr` Secrets",

translations/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
"Due to issues with CRI-O post v1.17.3, we need to restart your cluster.": "Debido a problemas con CRI-O post v1.17.3, necesitamos reiniciar tu cluster.",
190190
"Due to networking limitations of driver {{.driver_name}} on {{.os_name}}, {{.addon_name}} addon is not supported.\nAlternatively to use this addon you can use a vm-based driver:\n\n\t'minikube start --vm=true'\n\nTo track the update on this work in progress feature please check:\nhttps://github.com/kubernetes/minikube/issues/7332": "Debido a las limitaciones de red del controlador {{.driver_name}} en {{.os_name}}, el complemento \"{{.addon_name}}\" no está soportado.\nPara usar este complemento, puedes utilizar un controlador basado en vm\n\n\t'minikube start --vm=true'\n\nPara realizar un seguimiento de las actualizaciones de esta función consulte:\nhttps://github.com/kubernetes/minikube/issues/7332",
191191
"Due to networking limitations of driver {{.driver_name}}, {{.addon_name}} addon is not supported. Try using a different driver.": "Debido a limitaciones de red del controlador {{.driver_name}}, el complemento \"{{.addon_name}}\" no está soportado. Intenta usar un controlador diferente.",
192+
"Due to security improvements to minikube the VMware driver is currently not supported. Available workarounds are to use a different driver or downgrade minikube to v1.29.0.\n\n We are accepting community contributions to fix this, for more details on the issue see: https://github.com/kubernetes/minikube/issues/16221\n": "",
192193
"Duration until minikube certificate expiration, defaults to three years (26280h).": "",
193194
"ERROR creating `registry-creds-acr` secret": "ERROR creando el secreto `registry-creds-acr`",
194195
"ERROR creating `registry-creds-dpr` secret": "ERROR creando el secreto `registry-creds-dpr`",

translations/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
"Downloading driver {{.driver}}:": "Téléchargement du pilote {{.driver}} :",
184184
"Due to DNS issues your cluster may have problems starting and you may not be able to pull images\nMore details available at: https://minikube.sigs.k8s.io/docs/drivers/qemu/#known-issues": "En raison de problèmes DNS, votre cluster peut avoir des problèmes de démarrage et vous ne pourrez peut-être pas extraire d'images\nPlus de détails disponibles sur : https://minikube.sigs.k8s.io/docs/drivers/qemu/#known-issues",
185185
"Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. You can use alternative drivers such as docker or {{.driver}}.\n https://minikube.sigs.k8s.io/docs/drivers/docker/\n https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}/\n\n For more details on the issue see: https://github.com/kubernetes/minikube/issues/15274\n": "En raison de changements dans macOS 13+, minikube ne prend actuellement pas en charge VirtualBox. Vous pouvez utiliser des pilotes alternatifs tels que docker ou {{.driver}}.\n https://minikube.sigs.k8s.io/docs/drivers/docker/\n https://minikube.sigs.k8s.io/ docs/drivers/{{.driver}}/\n\n Pour plus de détails sur le problème, voir : https://github.com/kubernetes/minikube/issues/15274\n",
186+
"Due to security improvements to minikube the VMware driver is currently not supported. Available workarounds are to use a different driver or downgrade minikube to v1.29.0.\n\n We are accepting community contributions to fix this, for more details on the issue see: https://github.com/kubernetes/minikube/issues/16221\n": "",
186187
"Duration until minikube certificate expiration, defaults to three years (26280h).": "Durée jusqu'à l'expiration du certificat minikube, par défaut à trois ans (26280h).",
187188
"ERROR creating `registry-creds-acr` secret": "ERREUR lors de la création du secret `registry-creds-acr`",
188189
"ERROR creating `registry-creds-dpr` secret": "ERREUR lors de la création du secret `registry-creds-dpr`",

translations/ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
"Downloading driver {{.driver}}:": "{{.driver}} ドライバーをダウンロードしています:",
174174
"Due to DNS issues your cluster may have problems starting and you may not be able to pull images\nMore details available at: https://minikube.sigs.k8s.io/docs/drivers/qemu/#known-issues": "DNS の問題により、クラスターの起動に問題が発生し、イメージを取得できない場合があります\n詳細については、https://minikube.sigs.k8s.io/docs/drivers/qemu/#known-issues を参照してください",
175175
"Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. You can use alternative drivers such as docker or {{.driver}}.\n https://minikube.sigs.k8s.io/docs/drivers/docker/\n https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}/\n\n For more details on the issue see: https://github.com/kubernetes/minikube/issues/15274\n": "",
176+
"Due to security improvements to minikube the VMware driver is currently not supported. Available workarounds are to use a different driver or downgrade minikube to v1.29.0.\n\n We are accepting community contributions to fix this, for more details on the issue see: https://github.com/kubernetes/minikube/issues/16221\n": "",
176177
"Duration until minikube certificate expiration, defaults to three years (26280h).": "minikube 証明書の有効期限。デフォルトは 3 年間 (26280h)。",
177178
"ERROR creating `registry-creds-acr` secret": "`registry-creds-acr` シークレット作成中にエラーが発生しました",
178179
"ERROR creating `registry-creds-dpr` secret": "`registry-creds-dpr` シークレット作成中にエラーが発生しました",

0 commit comments

Comments
 (0)