File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,10 @@ func runStart(cmd *cobra.Command, _ []string) {
269269
270270 validateBuiltImageVersion (starter .Runner , ds .Name )
271271
272+ if viper .GetBool (createMount ) {
273+ warnAboutMountFlag ()
274+ }
275+
272276 if existing != nil && driver .IsKIC (existing .Driver ) && viper .GetString (mountString ) != "" {
273277 old := ""
274278 if len (existing .ContainerVolumeMounts ) > 0 {
@@ -2099,3 +2103,22 @@ func startNerdctld() {
20992103 exit .Error (reason .StartNerdctld , fmt .Sprintf ("Failed to set up DOCKER_HOST: %s" , rest .Output ()), err )
21002104 }
21012105}
2106+
2107+ func warnAboutMountFlag () {
2108+ homeDir , err := os .UserHomeDir ()
2109+ if err != nil {
2110+ out .WarningT ("Failed to get home directory: {{.err}}" , out.V {"err" : err })
2111+ }
2112+
2113+ // Detect usage of --mount without --mount-string
2114+ if viper .Get (mountString ) == "" {
2115+ out .WarningT ("The --mount flag is ignored." )
2116+ out .Styled (style .Tip , "To mount a host folder, please use the --mount-string flag." )
2117+ out .Styled (style .Option , "Example: minikube start --mount-string=\" {{.home}}/shared:/mnt/shared\" " , out.V {"home" : homeDir })
2118+ }
2119+
2120+ // Detect usage of --mount with --mount-string
2121+ if viper .Get (mountString ) != "" {
2122+ out .WarningT ("The --mount flag is ignored when --mount-string is specified and is not needed." )
2123+ }
2124+ }
You can’t perform that action at this time.
0 commit comments