mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
cli: store kubernetes version as strong type in config (#2287)
Co-authored-by: Otto Bittner <cobittner@posteo.net> Co-authored-by: 3u13r <lc@edgeless.systems>
This commit is contained in:
parent
348418a4a1
commit
22c2a73ae2
23 changed files with 293 additions and 182 deletions
|
@ -637,22 +637,6 @@ func (c *Config) validateK8sVersion(fl validator.FieldLevel) bool {
|
|||
return err == nil
|
||||
}
|
||||
|
||||
// K8sVersionFromMajorMinor takes a semver in format MAJOR.MINOR
|
||||
// and returns the version in format MAJOR.MINOR.PATCH with the
|
||||
// supported patch version as PATCH.
|
||||
func K8sVersionFromMajorMinor(version string) string {
|
||||
switch version {
|
||||
case semver.MajorMinor(string(versions.V1_26)):
|
||||
return string(versions.V1_26)
|
||||
case semver.MajorMinor(string(versions.V1_27)):
|
||||
return string(versions.V1_27)
|
||||
case semver.MajorMinor(string(versions.V1_28)):
|
||||
return string(versions.V1_28)
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
func registerImageCompatibilityError(ut ut.Translator) error {
|
||||
return ut.Add("image_compatibility", "{0} specifies an invalid version: {1}", true)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue