diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 03e76c6000365a75cf97c697ef18b207a227256c..aaa5fbe55e212ff22509eb96f4d34f0007826b2a 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -210,8 +210,11 @@ func runStart(cmd *cobra.Command, args []string) { if viper.GetBool(createMount) { mount := viper.GetString(mountString) if len(existing.ContainerVolumeMounts) != 1 || existing.ContainerVolumeMounts[0] != mount { - out.WarningT("Due to the limitations of {{.driver}}, it's not possible to the change mount configuration of an existing cluster.", out.V{"driver": existing.Driver}) - out.WarningT("If necessary delete and recreate the cluster, proceeding with old mount configuration") + exit.Message(reason.GuestMountConflict, "Sorry, {{.driver}} does not allow mounts to be changed after container creation (previous mount: '{{.old}}', new mount: '{{.new}})'", out.V{ + "driver": existing.Driver, + "new": mount, + "old": existing.ContainerVolumeMounts[0], + }) } } diff --git a/pkg/minikube/reason/reason.go b/pkg/minikube/reason/reason.go index c5a96d9932d97f1515c8d77a4e902017e958ac2c..21b4bb8b95048f96fde25bd4d14bd258c1e2ffe6 100644 --- a/pkg/minikube/reason/reason.go +++ b/pkg/minikube/reason/reason.go @@ -214,6 +214,7 @@ var ( GuestDeletion = Kind{ID: "GUEST_DELETION", ExitCode: ExGuestError} GuestLoadHost = Kind{ID: "GUEST_LOAD_HOST", ExitCode: ExGuestError} GuestMount = Kind{ID: "GUEST_MOUNT", ExitCode: ExGuestError} + GuestMountConflict = Kind{ID: "GUEST_MOUNT_CONFLICT", ExitCode: ExGuestConflict} GuestNodeAdd = Kind{ID: "GUEST_NODE_ADD", ExitCode: ExGuestError} GuestNodeDelete = Kind{ID: "GUEST_NODE_DELETE", ExitCode: ExGuestError} GuestNodeProvision = Kind{ID: "GUEST_NODE_PROVISION", ExitCode: ExGuestError}