config: detailed validation errors for k8s version (#1018)

These extended error messages help users in understanding
what is wrong with the current configuration and how to
remediate the issue.
This commit is contained in:
Otto Bittner 2023-01-23 11:21:06 +01:00 committed by GitHub
parent 03154c6e64
commit 3b59ebfd53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View file

@ -489,6 +489,10 @@ func (c *Config) Validate() error {
return err
}
if err := validate.RegisterTranslation("supported_k8s_version", trans, registerInvalidK8sVersionError, translateInvalidK8sVersionError); err != nil {
return err
}
if err := validate.RegisterValidation("no_placeholders", validateNoPlaceholder); err != nil {
return err
}