cli: skip k8s upgrade in case of outdated version (#1864)

If an unsupported, outdated k8s patch version is used,
the user should still be able to run upgrade apply.
This commit is contained in:
Otto Bittner 2023-06-05 09:13:02 +02:00 committed by GitHub
parent eb9bea1cff
commit 6bda62d397
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 107 additions and 16 deletions

View file

@ -390,8 +390,10 @@ func getPlaceholderEntries(m measurements.M) []uint32 {
return placeholders
}
// validateK8sVersion does not check the patch version.
func (c *Config) validateK8sVersion(fl validator.FieldLevel) bool {
return versions.IsSupportedK8sVersion(compatibility.EnsurePrefixV(fl.Field().String()))
_, err := versions.NewValidK8sVersion(compatibility.EnsurePrefixV(fl.Field().String()), false)
return err == nil
}
// K8sVersionFromMajorMinor takes a semver in format MAJOR.MINOR