mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
config: only print upgrade deprecation msg if key is set
This commit is contained in:
parent
7454b69f13
commit
2042e6b338
@ -365,7 +365,16 @@ func returnsTrue(fl validator.FieldLevel) bool {
|
|||||||
|
|
||||||
// validateUpgradeConfig prints a warning to STDERR and validates the field successfully.
|
// validateUpgradeConfig prints a warning to STDERR and validates the field successfully.
|
||||||
func validateUpgradeConfig(sl validator.StructLevel) {
|
func validateUpgradeConfig(sl validator.StructLevel) {
|
||||||
fmt.Printf("WARNING: the config key `upgrade` will be deprecated in an upcoming version. Please check the documentation for more information.\n")
|
config, ok := sl.Current().Interface().(UpgradeConfig)
|
||||||
|
if !ok {
|
||||||
|
sl.ReportError(config, "upgrade", "UpgradeConfig", "malformed_upgrade_config", "")
|
||||||
|
}
|
||||||
|
// A valid `upgrade` section will always have a non-nil Measurements map.
|
||||||
|
// Only print a warning if the user actually specified an upgrade section.
|
||||||
|
if config.Image == "" && config.CSP == cloudprovider.Unknown && config.Measurements == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("WARNING: the config key `upgrade` will be deprecated in an upcoming version. Please check the documentation for more information.")
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerValidateNameError(ut ut.Translator) error {
|
func registerValidateNameError(ut ut.Translator) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user