From dd5eb4e1c39bf9c4dee17378f48caad0bc9149f1 Mon Sep 17 00:00:00 2001 From: Rohan CJ Date: Wed, 11 Sep 2024 12:39:52 +0530 Subject: [PATCH] fix(cli): do not upgrade if latest stable is older(eg: beta) Signed-off-by: Rohan CJ --- pkg/upgrade/upgrade.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/upgrade/upgrade.go b/pkg/upgrade/upgrade.go index 676162e59c..5c3ee158d5 100644 --- a/pkg/upgrade/upgrade.go +++ b/pkg/upgrade/upgrade.go @@ -78,7 +78,8 @@ func CheckForNewerVersion() (string, error) { } v := semver.MustParse(version) - if !found || latest.Version.Equals(v) { + // if latest not found or latest version found is less than or equal to the current version, do not upgrade + if !found || latest.Version.Compare(v) != 1 { return }