Merge pull request #8831 from priyawadhwa/overlay

Set preload=false if not using overlay2 as docker storage driver
pull/8164/head
Sharif Elgamal 2020-09-09 11:45:52 -07:00 committed by GitHub
commit ee5b8f130f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -252,6 +252,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) {
@ -1204,6 +1205,28 @@ 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(drvName); err != nil {
exit.Error(reason.DrvNotFound, fmt.Sprintf("%s not found on PATH", drvName), err)
}
si, err := oci.DaemonInfo(drvName)
if err != nil {
glog.Warningf("Unable to confirm that %s is using overlay2 storage driver; setting preload=false", drvName)
viper.Set(preload, false)
return
}
if si.StorageDriver == "overlay2" {
return
}
out.WarningT("{{.Driver}} is currently using the {{.StorageDriver}} storage driver, consider switching to overlay2 for better performance", out.V{"StorageDriver": si.StorageDriver, "Driver": drvName})
viper.Set(preload, false)
}
func exitIfNotForced(r reason.Kind, message string, v ...out.V) {
if !viper.GetBool(force) {
exit.Message(r, message, v...)

0
pkg/drivers/kic/oci/test Normal file
View File