diff --git a/cmd/minikube/cmd/docker-env.go b/cmd/minikube/cmd/docker-env.go index d9bba7a311..8569a7147c 100644 --- a/cmd/minikube/cmd/docker-env.go +++ b/cmd/minikube/cmd/docker-env.go @@ -141,6 +141,10 @@ var dockerEnvCmd = &cobra.Command{ exit.UsageT(`'none' driver does not support 'minikube docker-env' command`) } + if len(co.Config.Nodes) > 1 { + exit.WithCodeT(exit.BadUsage, `The docker-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/`) + } + if co.Config.KubernetesConfig.ContainerRuntime != "docker" { exit.WithCodeT(exit.BadUsage, `The docker-env command is only compatible with the "docker" runtime, but this cluster was configured to use the "{{.runtime}}" runtime.`, out.V{"runtime": co.Config.KubernetesConfig.ContainerRuntime}) diff --git a/cmd/minikube/cmd/podman-env.go b/cmd/minikube/cmd/podman-env.go index 8bff0ce56f..612cd7d402 100644 --- a/cmd/minikube/cmd/podman-env.go +++ b/cmd/minikube/cmd/podman-env.go @@ -116,6 +116,10 @@ var podmanEnvCmd = &cobra.Command{ exit.UsageT(`'none' driver does not support 'minikube podman-env' command`) } + if len(co.Config.Nodes) > 1 { + exit.WithCodeT(exit.BadUsage, `The podman-env command is incompatible with multi-node clusters. Use the 'registry' add-on: https://minikube.sigs.k8s.io/docs/handbook/registry/`) + } + if ok := isPodmanAvailable(co.CP.Runner); !ok { exit.WithCodeT(exit.Unavailable, `The podman service within '{{.cluster}}' is not active`, out.V{"cluster": cname}) }