compatibility: allow newer patch versions for images

Validation incorrectly prevented newer patch versions for images.
This commit is contained in:
Otto Bittner 2023-02-15 10:22:54 +01:00
parent 2a0b56f7b8
commit 6f9d76dd6e
3 changed files with 23 additions and 6 deletions

View file

@ -90,7 +90,8 @@ func BinaryWith(target string) error {
if cliMajor != targetMajor {
return ErrMajorMismatch
}
if semver.Compare(binaryVersion, target) == -1 {
// For images we allow newer patch versions, therefore this only checks the minor version.
if semver.Compare(semver.MajorMinor(binaryVersion), semver.MajorMinor(target)) == -1 {
return ErrOutdatedCLI
}
// Abort if minor version drift between CLI and versionA value is greater than 1.