You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/minikube/cmd/start.go
+12-25
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ const (
105
105
hostDNSResolver="host-dns-resolver"
106
106
waitUntilHealthy="wait"
107
107
force="force"
108
+
interactive="interactive"
108
109
waitTimeout="wait-timeout"
109
110
nativeSSH="native-ssh"
110
111
)
@@ -140,6 +141,7 @@ func initMinikubeFlags() {
140
141
viper.AutomaticEnv()
141
142
142
143
startCmd.Flags().Bool(force, false, "Force minikube to perform possibly dangerous operations")
144
+
startCmd.Flags().Bool(interactive, true, "Allow user prompts for more information")
143
145
144
146
startCmd.Flags().Int(cpus, constants.DefaultCPUS, "Number of CPUs allocated to the minikube VM.")
145
147
startCmd.Flags().String(memory, constants.DefaultMemorySize, "Amount of RAM allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g).")
out.T(out.Permissions, "The '{{.driver}}' driver requires elevated permissions. The following commands will be executed:\n\n{{ .example }}\n", out.V{"driver": driver, "example": example.String()})
196
+
for_, c:=rangecmds {
197
+
testArgs:=append([]string{"-n"}, c.Args[1:]...)
198
+
test:=exec.Command("sudo", testArgs...)
199
+
glog.Infof("testing: %v", test.Args)
200
+
iferr:=test.Run(); err!=nil {
201
+
glog.Infof("%v may require a password: %v", c.Args, err)
202
+
if!interactive {
203
+
returnfmt.Errorf("%v requires a password, and --interactive=false", c.Args)
204
+
}
205
+
}
206
+
glog.Infof("running: %v", c.Args)
207
+
err:=c.Run()
208
+
iferr!=nil {
209
+
returnerrors.Wrapf(err, "%v", c.Args)
210
+
}
211
+
}
212
+
returnnil
213
+
}
214
+
215
+
// validateDriver validates if a driver appears to be up-to-date and installed properly
216
+
funcvalidateDriver(driverstring, v semver.Version) (string, error) {
msg:=fmt.Sprintf("A new hyperkit driver was installed. It needs elevated permissions to run. The following commands will be executed:\n\n $ sudo chown root:wheel %s\n $ sudo chmod u+s %s\n", driverPath, driverPath)
0 commit comments