From 6c0619735d28c9c2921bfc59448f82c0cc3f6d00 Mon Sep 17 00:00:00 2001 From: zwwhdls Date: Fri, 27 Sep 2024 15:49:53 +0800 Subject: [PATCH] fix version compare Signed-off-by: zwwhdls --- pkg/util/version.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/util/version.go b/pkg/util/version.go index 9a11147..ebc414a 100644 --- a/pkg/util/version.go +++ b/pkg/util/version.go @@ -38,16 +38,16 @@ func (v ClientVersion) LessThan(o ClientVersion) bool { if o.Dev { return true } - if o.Major > v.Major { - return true + if v.Dev { + return false } - if o.Minor > v.Minor { - return true + if v.Major != o.Major { + return v.Major < o.Major } - if o.Patch > v.Patch { - return true + if v.Minor != o.Minor { + return v.Minor < o.Minor } - return false + return v.Patch < o.Patch } func ParseClientVersion(image string) ClientVersion {