ignoreErrors.Insert(strings.ToLower(item))// parameters are case insensitive
ignoreErrors.Insert(strings.ToLower(item))// parameters are case insensitive
}
}
// TODO: remove once deprecated flag --skip-preflight-checks is removed.
ifskipPreflightChecks{
ignoreErrors.Insert("all")
}
ifignoreErrors.Has("all")&&ignoreErrors.Len()>1{
ifignoreErrors.Has("all")&&ignoreErrors.Len()>1{
allErrs=append(allErrs,field.Invalid(field.NewPath("ignore-preflight-errors"),strings.Join(ignoreErrors.List(),","),"don't specify individual checks if 'all' is used"))
allErrs=append(allErrs,field.Invalid(field.NewPath("ignore-preflight-errors"),strings.Join(ignoreErrors.List(),","),"don't specify individual checks if 'all' is used"))
t.Errorf("ValidateIgnorePreflightErrors: unexpected error for input (%s, %v), error: %v",rt.ignorePreflightErrors,rt.skipPreflightChecks,err)
t.Errorf("ValidateIgnorePreflightErrors: unexpected error for input (%s), error: %v",rt.ignorePreflightErrors,err)
caseerr==nil&&rt.expectedError:
caseerr==nil&&rt.expectedError:
t.Errorf("ValidateIgnorePreflightErrors: expected error for input (%s, %v) but got: %v",rt.ignorePreflightErrors,rt.skipPreflightChecks,result)
t.Errorf("ValidateIgnorePreflightErrors: expected error for input (%s) but got: %v",rt.ignorePreflightErrors,result)
caseresult.Len()!=rt.expectedLen:
caseresult.Len()!=rt.expectedLen:
t.Errorf("ValidateIgnorePreflightErrors: expected Len = %d for input (%s, %v) but got: %v, %v",rt.expectedLen,rt.ignorePreflightErrors,rt.skipPreflightChecks,result.Len(),result)
t.Errorf("ValidateIgnorePreflightErrors: expected Len = %d for input (%s) but got: %v, %v",rt.expectedLen,rt.ignorePreflightErrors,result.Len(),result)
Short:"Check which versions are available to upgrade to and validate whether your current cluster is upgradeable. To skip the internet check, pass in the optional [version] parameter.",
Short:"Check which versions are available to upgrade to and validate whether your current cluster is upgradeable. To skip the internet check, pass in the optional [version] parameter.",
fs.BoolVar(&flags.allowRCUpgrades,"allow-release-candidate-upgrades",flags.allowRCUpgrades,"Show release candidate versions of Kubernetes as an upgrade alternative and allow upgrading to a release candidate versions of Kubernetes.")
fs.BoolVar(&flags.allowRCUpgrades,"allow-release-candidate-upgrades",flags.allowRCUpgrades,"Show release candidate versions of Kubernetes as an upgrade alternative and allow upgrading to a release candidate versions of Kubernetes.")
fs.BoolVar(&flags.printConfig,"print-config",flags.printConfig,"Specifies whether the configuration file that will be used in the upgrade should be printed or not.")
fs.BoolVar(&flags.printConfig,"print-config",flags.printConfig,"Specifies whether the configuration file that will be used in the upgrade should be printed or not.")
fs.StringSliceVar(&flags.ignorePreflightErrors,"ignore-preflight-errors",flags.ignorePreflightErrors,"A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
fs.StringSliceVar(&flags.ignorePreflightErrors,"ignore-preflight-errors",flags.ignorePreflightErrors,"A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
fs.BoolVar(&flags.skipPreFlight,"skip-preflight-checks",flags.skipPreFlight,"Skip preflight checks that normally run before modifying the system.")
fs.MarkDeprecated("skip-preflight-checks","it is now equivalent to --ignore-preflight-errors=all")
fs.MarkDeprecated("skip-preflight-checks","it is now equivalent to --ignore-preflight-errors=all")
fs.StringVar(&flags.featureGatesString,"feature-gates",flags.featureGatesString,"A set of key=value pairs that describe feature gates for various features."+
fs.StringVar(&flags.featureGatesString,"feature-gates",flags.featureGatesString,"A set of key=value pairs that describe feature gates for various features."+