Merge b2c2ea415e into 4c7716be2c
commit
a5adad0a2c
|
|
@ -273,6 +273,10 @@ func runStart(cmd *cobra.Command, _ []string) {
|
|||
|
||||
validateBuiltImageVersion(starter.Runner, ds.Name)
|
||||
|
||||
if viper.GetBool(createMount) {
|
||||
warnAboutMountFlag()
|
||||
}
|
||||
|
||||
if existing != nil && driver.IsKIC(existing.Driver) && viper.GetString(mountString) != "" {
|
||||
old := ""
|
||||
if len(existing.ContainerVolumeMounts) > 0 {
|
||||
|
|
@ -2104,3 +2108,22 @@ func startNerdctld(options *run.CommandOptions) {
|
|||
exit.Error(reason.StartNerdctld, fmt.Sprintf("Failed to set up DOCKER_HOST: %s", rest.Output()), err)
|
||||
}
|
||||
}
|
||||
|
||||
func warnAboutMountFlag() {
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
out.WarningT("Failed to get home directory: {{.err}}", out.V{"err": err})
|
||||
}
|
||||
|
||||
// Detect usage of --mount without --mount-string
|
||||
if viper.Get(mountString) == "" {
|
||||
out.WarningT("The --mount flag is ignored.")
|
||||
out.Styled(style.Tip, "To mount a host folder, please use the --mount-string flag.")
|
||||
out.Styled(style.Option, "Example: minikube start --mount-string=\"{{.home}}/shared:/mnt/shared\"", out.V{"home": homeDir})
|
||||
}
|
||||
|
||||
// Detect usage of --mount with --mount-string
|
||||
if viper.Get(mountString) != "" {
|
||||
out.WarningT("The --mount flag is ignored when --mount-string is specified and is not needed.")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue