From eb884228a4eba572808281feb62607f893eac46a Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Tue, 10 Jan 2023 10:14:27 -0800 Subject: [PATCH 1/2] warn users if using VirtualBox on macOS 13+ --- cmd/minikube/cmd/start.go | 15 +++++++++++++++ pkg/minikube/detect/detect.go | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index aad46a520fdb..49a40ef9c18b 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -300,6 +300,7 @@ func provisionWithDriver(cmd *cobra.Command, ds registry.DriverState, existing * klog.Errorf("Error autoSetOptions : %v", err) } + virtualBoxMacOS13PlusWarning(driverName) validateFlags(cmd, driverName) validateUser(driverName) if driverName == oci.Docker { @@ -373,6 +374,20 @@ func provisionWithDriver(cmd *cobra.Command, ds registry.DriverState, existing * }, nil } +func virtualBoxMacOS13PlusWarning(driverName string) { + if driverName != "virtualbox" || !detect.MacOS13Plus() { + return + } + driver := "hyperkit" + if runtime.GOARCH == "arm64" { + driver = "qemu" + } + out.WarningT(`Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. We recommend using the {{.driver}} driver: https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}/ + + For more details on the issue see: https://github.com/kubernetes/minikube/issues/15274 +`, out.V{"driver": driver}) +} + func validateBuiltImageVersion(r command.Runner) { res, err := r.RunCmd(exec.Command("cat", "/version.json")) if err != nil { diff --git a/pkg/minikube/detect/detect.go b/pkg/minikube/detect/detect.go index 5bb51753e363..0c4ec9c2d0fb 100644 --- a/pkg/minikube/detect/detect.go +++ b/pkg/minikube/detect/detect.go @@ -23,6 +23,7 @@ import ( "os/exec" "path/filepath" "runtime" + "strconv" "strings" "github.com/klauspost/cpuid" @@ -165,3 +166,21 @@ func CgroupDriver() string { return constants.DefaultCgroupDriver // try with default rather than just give up } } + +// MacOS13Plus returns if the current machine is running macOS 13+ +func MacOS13Plus() bool { + if runtime.GOOS != "darwin" { + return false + } + o, err := exec.Command("sw_vers", "-productVersion").Output() + if err != nil { + klog.Warningf("failed to get macOS version: %v", err) + return false + } + major, err := strconv.Atoi(strings.Split(string(o), ".")[0]) + if err != nil { + klog.Warningf("failed to convert macOS version to int: %v", err) + return false + } + return major >= 13 +} From 5dbb92fbee3c467e156a0bfc511c83af656241b6 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Tue, 17 Jan 2023 12:45:09 -0800 Subject: [PATCH 2/2] update message --- cmd/minikube/cmd/start.go | 4 +++- translations/de.json | 1 + translations/es.json | 1 + translations/fr.json | 1 + translations/ja.json | 1 + translations/ko.json | 1 + translations/pl.json | 1 + translations/ru.json | 1 + translations/strings.txt | 1 + translations/zh-CN.json | 1 + 10 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 49a40ef9c18b..2c9c8d40d9c8 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -382,7 +382,9 @@ func virtualBoxMacOS13PlusWarning(driverName string) { if runtime.GOARCH == "arm64" { driver = "qemu" } - out.WarningT(`Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. We recommend using the {{.driver}} driver: https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}/ + out.WarningT(`Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. You can use alternative drivers such as docker or {{.driver}}. + https://minikube.sigs.k8s.io/docs/drivers/docker/ + https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}/ For more details on the issue see: https://github.com/kubernetes/minikube/issues/15274 `, out.V{"driver": driver}) diff --git a/translations/de.json b/translations/de.json index 1899316a65ec..c8ede36b6362 100644 --- a/translations/de.json +++ b/translations/de.json @@ -178,6 +178,7 @@ "Downloading VM boot image ...": "Lade VM boot image herunter ...", "Downloading driver {{.driver}}:": "Lade Treiber {{.driver}} herunter:", "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": "", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "Dauer bis das Minikube-Zertifikat abläuft, Default ist drei Jahre (26280 Stunden).", "ERROR creating `registry-creds-acr` secret": "Fehler beim Erstellen des `registry-creds-acr` Secrets", "ERROR creating `registry-creds-dpr` secret": "Fehler beim Erstellen des `registry-creds-dpr` Secrets", diff --git a/translations/es.json b/translations/es.json index 5ff53bd23a45..192bce3e18ad 100644 --- a/translations/es.json +++ b/translations/es.json @@ -183,6 +183,7 @@ "Downloading VM boot image ...": "Descargando la imagen de arranque de la VM", "Downloading driver {{.driver}}:": "Descargando el controlador {{.driver}}:", "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": "", + "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": "", "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.", "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", "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.", diff --git a/translations/fr.json b/translations/fr.json index 1732f47b0cd2..b16a247e633c 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -179,6 +179,7 @@ "Downloading VM boot image ...": "Téléchargement de l'image de démarrage de la VM...", "Downloading driver {{.driver}}:": "Téléchargement du pilote {{.driver}} :", "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", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "Durée jusqu'à l'expiration du certificat minikube, par défaut à trois ans (26280h).", "ERROR creating `registry-creds-acr` secret": "ERREUR lors de la création du secret `registry-creds-acr`", "ERROR creating `registry-creds-dpr` secret": "ERREUR lors de la création du secret `registry-creds-dpr`", diff --git a/translations/ja.json b/translations/ja.json index 66e75343963e..9aef4bf25d39 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -169,6 +169,7 @@ "Downloading VM boot image ...": "VM ブートイメージをダウンロードしています...", "Downloading driver {{.driver}}:": "{{.driver}} ドライバーをダウンロードしています:", "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 を参照してください", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "minikube 証明書の有効期限。デフォルトは 3 年間 (26280h)。", "ERROR creating `registry-creds-acr` secret": "`registry-creds-acr` シークレット作成中にエラーが発生しました", "ERROR creating `registry-creds-dpr` secret": "`registry-creds-dpr` シークレット作成中にエラーが発生しました", diff --git a/translations/ko.json b/translations/ko.json index 5290809051f6..6c95450c120f 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -188,6 +188,7 @@ "Downloading driver {{.driver}}:": "드라이버 {{.driver}} 다운로드 중 :", "Downloading {{.name}} {{.version}}": "{{.name}} {{.version}} 다운로드 중", "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": "", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "", "ERROR creating `registry-creds-acr` secret": "registry-creds-acr` secret 생성 오류", "ERROR creating `registry-creds-dpr` secret": "`registry-creds-dpr` secret 생성 오류", diff --git a/translations/pl.json b/translations/pl.json index 7c94161ea3c8..ec44eddc9477 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -188,6 +188,7 @@ "Downloading driver {{.driver}}:": "", "Downloading {{.name}} {{.version}}": "Pobieranie {{.name}} {{.version}}", "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": "", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "", diff --git a/translations/ru.json b/translations/ru.json index a366b53fcbb8..ab9edae34275 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -167,6 +167,7 @@ "Downloading VM boot image ...": "", "Downloading driver {{.driver}}:": "", "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": "", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "", diff --git a/translations/strings.txt b/translations/strings.txt index 96b20fc9dbd6..0cd322d4321b 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -167,6 +167,7 @@ "Downloading VM boot image ...": "", "Downloading driver {{.driver}}:": "", "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": "", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index e6c661863681..d717e0566f18 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -214,6 +214,7 @@ "Downloading driver {{.driver}}:": "正在下载驱动 {{.driver}}:", "Downloading {{.name}} {{.version}}": "正在下载 {{.name}} {{.version}}", "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": "", + "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": "", "Duration until minikube certificate expiration, defaults to three years (26280h).": "", "ERROR creating `registry-creds-acr` secret": "", "ERROR creating `registry-creds-dpr` secret": "创建 `registry-creds-dpr` secret 时出错",