Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set preload=false if not using overlay2 as docker storage driver #8831

Merged
merged 6 commits into from
Sep 9, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func provisionWithDriver(cmd *cobra.Command, ds registry.DriverState, existing *

validateFlags(cmd, driverName)
validateUser(driverName)
validateDockerStorageDriver(driverName)

// Download & update the driver, even in --download-only mode
if !viper.GetBool(dryRun) {
Expand Down Expand Up @@ -1158,3 +1159,26 @@ func getKubernetesVersion(old *config.ClusterConfig) string {

return version.VersionPrefix + nvs.String()
}

// validateDockerStorageDriver checks that docker is using overlay2
// if not, set preload=false (see #7626)
func validateDockerStorageDriver(drvName string) {
if !driver.IsKIC(drvName) {
return
}
if _, err := exec.LookPath("docker"); err != nil {
exit.WithCodeT(exit.BadUsage, "Please make sure docker is available on your PATH")
}
j, err := exec.Command("docker", "info", "--format", "{{.Driver}}").Output()
priyawadhwa marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
glog.Warningf("Unable to confirm that docker is using overlay2; setting preload=false")
viper.Set(preload, false)
return
}
driver := strings.Trim(string(j), "\n")
if driver == "overlay2" {
return
}
out.WarningT("Docker is currently using the {{.Driver}} storage driver. Consider switching to overlay2 for better performance.", out.V{"Driver": driver})
viper.Set(preload, false)
}