bring back check for dry run

pull/8877/head
Medya Gh 2020-08-03 13:27:49 -07:00
parent e59a026450
commit d782f80e23
2 changed files with 7 additions and 2 deletions

View File

@ -950,6 +950,11 @@ func validateFlags(cmd *cobra.Command, drvName string) {
if !driver.HasResourceLimits(drvName) {
out.WarningT("The '{{.name}}' driver does not respect the --memory flag", out.V{"name": drvName})
}
req, err := util.CalculateSizeInMB(viper.GetString(memory))
if err != nil {
exit.WithCodeT(exit.Config, "Unable to parse memory '{{.memory}}': {{.error}}", out.V{"memory": viper.GetString(memory), "error": err})
}
validateMemorySize(req, drvName)
}
if cmd.Flags().Changed(containerRuntime) {

View File

@ -236,12 +236,12 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
exit.UsageT("{{.driver_name}} has only {{.container_limit}}MB memory but you specified {{.specified_memory}}MB", out.V{"container_limit": containerLimit, "specified_memory": mem, "driver_name": driver.FullName(drvName)})
}
validateMemorySize(mem, drvName)
} else {
glog.Infof("Using suggested %dMB memory alloc based on sys=%dMB, container=%dMB", mem, sysLimit, containerLimit)
}
validateMemorySize(mem, drvName)
diskSize, err := pkgutil.CalculateSizeInMB(viper.GetString(humanReadableDiskSize))
if err != nil {
exit.WithCodeT(exit.Config, "Generate unable to parse disk size '{{.diskSize}}': {{.error}}", out.V{"diskSize": viper.GetString(humanReadableDiskSize), "error": err})