diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index d0bff65f06ae..4441013eb40b 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -225,9 +225,10 @@ func disableOthers(me Manager, cr CommandRunner) error { klog.Infof("skipping containerd shutdown because we are bound to it") continue } - - // runtime is already disabled, nothing to do. - if !r.Active() { + // in case of docker, if other runtime are already not active we are sure it is disabled, nothing to do. + // because #11515 for non-docker runtimes, we gotta ensure Docker is disabled and can not just check if it is not active + // since it is enabled by default in the current base image and it keeps coming back to life + if me.Name() == "Docker" && !r.Active() { continue } diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 531d3da30078..b3b2abab4350 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -150,6 +150,7 @@ func (r *Docker) Restart() error { // Disable idempotently disables Docker on a host func (r *Docker) Disable() error { + klog.Info("disabling docker service ...") // because #10373 if err := r.Init.ForceStop("docker.socket"); err != nil { klog.ErrorS(err, "Failed to stop", "service", "docker.socket") diff --git a/site/content/en/docs/contrib/errorcodes.en.md b/site/content/en/docs/contrib/errorcodes.en.md index f4ecd17c0851..76b47ce17ae8 100644 --- a/site/content/en/docs/contrib/errorcodes.en.md +++ b/site/content/en/docs/contrib/errorcodes.en.md @@ -285,6 +285,10 @@ minikube has no current cluster running "DRV_NOT_DETECTED" (Exit code ExDriverNotFound) +"DRV_NOT_HEALTHY" (Exit code ExDriverNotFound) + +"DRV_DOCKER_NOT_RUNNING" (Exit code ExDriverNotFound) + "DRV_AS_ROOT" (Exit code ExDriverPermission) "DRV_NEEDS_ROOT" (Exit code ExDriverPermission) @@ -329,6 +333,8 @@ minikube has no current cluster running "GUEST_PROVISION" (Exit code ExGuestError) +"GUEST_PROVISION_CONTAINER_EXITED" (Exit code ExGuestError) + "GUEST_START" (Exit code ExGuestError) "GUEST_STATUS" (Exit code ExGuestError) diff --git a/site/content/en/docs/contrib/tests.en.md b/site/content/en/docs/contrib/tests.en.md index 7fdb98ff8ac2..47ea10dca52f 100644 --- a/site/content/en/docs/contrib/tests.en.md +++ b/site/content/en/docs/contrib/tests.en.md @@ -166,6 +166,9 @@ to check existence of the test file #### validateCertSync to check existence of the test certificate +#### validateNotActiveRuntimeDisabled +asserts that for a given runtime, the other runtimes disabled, for example for containerd runtime, docker and crio needs to be not running + #### validateUpdateContextCmd asserts basic "update-context" command functionality diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 907b1ec93431..2616bf1535b9 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -138,6 +138,7 @@ func TestFunctional(t *testing.T) { {"RemoveImage", validateRemoveImage}, {"BuildImage", validateBuildImage}, {"ListImages", validateListImages}, + {"NonActiveRuntimeDisabled", validateNotActiveRuntimeDisabled}, } for _, tc := range tests { tc := tc @@ -1663,6 +1664,32 @@ func validateCertSync(ctx context.Context, t *testing.T, profile string) { } } +// validateNotActiveRuntimeDisabled asserts that for a given runtime, the other runtimes disabled, for example for containerd runtime, docker and crio needs to be not running +func validateNotActiveRuntimeDisabled(ctx context.Context, t *testing.T, profile string) { + if NoneDriver() { + t.Skip("skipping on none driver, minikube does not control the runtime of user on the none driver.") + } + disableMap := map[string][]string{ + "docker": {"crio"}, + "containerd": {"docker", "crio"}, + "crio": {"docker", "containerd"}, + } + + expectDisable := disableMap[ContainerRuntime()] + for _, cr := range expectDisable { + // for example: minikube sudo systemctl is-active docker + rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("sudo systemctl is-active %s", cr))) + got := rr.Stdout.String() + if err != nil && !strings.Contains(got, "inactive") { + t.Logf("output of %s: %v", rr.Output(), err) + } + if !strings.Contains(got, "inactive") { + t.Errorf("For runtime %q: expected %q to be inactive but got %q ", ContainerRuntime(), cr, got) + } + + } +} + // validateUpdateContextCmd asserts basic "update-context" command functionality func validateUpdateContextCmd(ctx context.Context, t *testing.T, profile string) { defer PostMortemLogs(t, profile) diff --git a/translations/de.json b/translations/de.json index de808b5f224f..ca995301065a 100644 --- a/translations/de.json +++ b/translations/de.json @@ -138,6 +138,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Docs have been saved at - {{.path}}": "", @@ -226,7 +227,6 @@ "Failed to change permissions for {{.minikube_dir_path}}: {{.error}}": "Fehler beim Ändern der Berechtigungen für {{.minikube_dir_path}}: {{.error}}", "Failed to check main repository and mirrors for images": "", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "", "Failed to delete cluster {{.name}}.": "", @@ -274,6 +274,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Force minikube to perform possibly dangerous operations": "minikube zwingen, möglicherweise gefährliche Operationen durchzuführen", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "Gefundene Netzwerkoptionen:", "Found {{.number}} invalid profile(s) ! ": "", "Generate command completion for a shell": "", diff --git a/translations/es.json b/translations/es.json index 03508b1dcd23..59ad3363f8c8 100644 --- a/translations/es.json +++ b/translations/es.json @@ -139,6 +139,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "Docker Desktop necesita estar configurado para contenedores Linux para poder usar minikube", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "Docker Desktop tiene solo {{.size}}MiB disponibles, menos que los {{.req}}MiB requeridos por Kubernetes", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "Docker Desktop tiene solo {{.size}}MiB disponibles, puede que encuentres fallas en tus deployments de aplicaciones", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "Docker tiene menos de 2 CPUs disponibles, pero Kubernetes requiere al menos 2 para estar disponible", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "No está disponible Docker dentro de la VM. Intenta usar 'minikube delete' para reestablecer la VM.", "Docs have been saved at - {{.path}}": "La documentación ha sido guardada en - {{.path}}", @@ -231,7 +232,6 @@ "Failed to change permissions for {{.minikube_dir_path}}: {{.error}}": "No se han podido cambiar los permisos de {{.minikube_dir_path}}: {{.error}}", "Failed to check main repository and mirrors for images": "", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "", "Failed to delete cluster {{.name}}.": "", @@ -279,6 +279,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Force minikube to perform possibly dangerous operations": "Permite forzar minikube para que realice operaciones potencialmente peligrosas", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "Se han encontrado las siguientes opciones de red:", "Found {{.number}} invalid profile(s) ! ": "", "Generate command completion for a shell": "", diff --git a/translations/fr.json b/translations/fr.json index 3e5e273c98be..e211c23fee38 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -140,6 +140,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Docs have been saved at - {{.path}}": "", @@ -228,7 +229,6 @@ "Failed to change permissions for {{.minikube_dir_path}}: {{.error}}": "Échec de la modification des autorisations pour {{.minikube_dir_path}} : {{.error}}", "Failed to check main repository and mirrors for images": "", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "", "Failed to delete cluster {{.name}}.": "", @@ -276,6 +276,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Force minikube to perform possibly dangerous operations": "Oblige minikube à réaliser des opérations possiblement dangereuses.", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "Options de réseau trouvées :", "Found {{.number}} invalid profile(s) ! ": "", "Generate command completion for a shell": "", diff --git a/translations/ja.json b/translations/ja.json index 346d3c0ce0c7..59659b88c268 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -135,6 +135,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Docs have been saved at - {{.path}}": "ドキュメントは以下のパスに保存されました。{{.path}}", @@ -218,7 +219,6 @@ "Failed to change permissions for {{.minikube_dir_path}}: {{.error}}": "{{.minikube_dir_path}} に対する権限を変更できませんでした。{{.error}}", "Failed to check main repository and mirrors for images": "", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "クラスタを削除できませんでしたが、処理を続行します。", "Failed to delete cluster {{.name}}.": "", @@ -264,6 +264,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Force minikube to perform possibly dangerous operations": "minikube で危険な可能性のある操作を強制的に実行します", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "ネットワーク オプションが見つかりました", "Found {{.number}} invalid profile(s) ! ": "", "Generate command completion for a shell": "シェルのコマンド補完コードを生成します", diff --git a/translations/ko.json b/translations/ko.json index 254bdcc25e59..8908c3f4bee2 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -148,6 +148,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Docs have been saved at - {{.path}}": "문서가 다음 경로에 저장되었습니다 - {{.path}}", @@ -246,7 +247,6 @@ "Failed to check if machine exists": "머신이 존재하는지 확인하는 데 실패하였습니다", "Failed to check main repository and mirrors for images": "", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "", "Failed to delete cluster {{.name}}.": "", @@ -296,6 +296,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Force minikube to perform possibly dangerous operations": "", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "네트워크 옵션을 찾았습니다", "Found {{.number}} invalid profile(s) !": "{{.number}} 개의 무효한 프로필을 찾았습니다", "Found {{.number}} invalid profile(s) ! ": "", diff --git a/translations/pl.json b/translations/pl.json index 12c6af152a0c..64792c17be59 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -148,6 +148,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Docs have been saved at - {{.path}}": "Dokumentacja została zapisana w {{.path}}", @@ -236,7 +237,6 @@ "Failed to change permissions for {{.minikube_dir_path}}: {{.error}}": "Nie udało się zmienić uprawnień pliku {{.minikube_dir_path}}: {{.error}}", "Failed to check main repository and mirrors for images": "", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "", "Failed to delete cluster {{.name}}.": "", @@ -283,6 +283,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Force minikube to perform possibly dangerous operations": "Wymuś wykonanie potencjalnie niebezpiecznych operacji", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "Wykryto opcje sieciowe:", "Found {{.number}} invalid profile(s) !": "Wykryto {{.number}} nieprawidłowych profili ! ", "Found {{.number}} invalid profile(s) ! ": "", diff --git a/translations/strings.txt b/translations/strings.txt index 71c344818ba6..fb7a27eb30f5 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -132,6 +132,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "", "Docs have been saved at - {{.path}}": "", @@ -212,7 +213,6 @@ "Failed to change permissions for {{.minikube_dir_path}}: {{.error}}": "", "Failed to check main repository and mirrors for images": "", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "", "Failed to delete cluster {{.name}}.": "", @@ -255,6 +255,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "", "Force minikube to perform possibly dangerous operations": "", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "", "Found {{.number}} invalid profile(s) ! ": "", "Generate command completion for a shell": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index 552574e31983..03b5a970517d 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -171,6 +171,7 @@ "Docker Desktop is configured for Windows containers, but Linux containers are required for minikube": "", "Docker Desktop only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes": "", "Docker Desktop only has {{.size}}MiB available, you may encounter application deployment failures.": "", + "Docker container exited prematurely after it was created, consider investigating Docker's performance/health.": "", "Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available": "", "Docker inside the VM is unavailable. Try running 'minikube delete' to reset the VM.": "虚拟机中的 Docker 不可用,尝试运行 'minikube delete' 来重置虚拟机。", "Docs have been saved at - {{.path}}": "文档已保存在 - {{.path}}", @@ -294,7 +295,6 @@ "Failed to check main repository and mirrors for images": "", "Failed to check main repository and mirrors for images for images": "无法检测主仓库和镜像仓库中的镜像", "Failed to configure metallb IP {{.profile}}": "", - "Failed to copying file": "", "Failed to create file": "", "Failed to delete cluster {{.name}}, proceeding with retry anyway.": "", "Failed to delete cluster {{.name}}.": "", @@ -348,6 +348,8 @@ "Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect": "强制为指定的 shell 配置环境:[fish, cmd, powershell, tcsh, bash, zsh],默认为 auto-detect", "Force minikube to perform possibly dangerous operations": "强制 minikube 执行可能有风险的操作", "Format to print stdout in. Options include: [text,json]": "", + "Found docker, but the docker service isn't running. Try restarting the docker service.": "", + "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.": "", "Found network options:": "找到的网络选项:", "Found {{.number}} invalid profile(s) !": "找到 {{.number}} 个无效的配置文件!", "Found {{.number}} invalid profile(s) ! ": "",