From 96dc8a787c7779a66c068f8720ebe602e67907b5 Mon Sep 17 00:00:00 2001 From: Shubham Bajpai Date: Tue, 7 Jul 2020 19:38:36 +0530 Subject: [PATCH] fix(version): split version string to segregate version from tags (#120) fixes the version check for valid desired version which needs to be split from the tags in the version string. Example: 1.11.0-RC1 needs to split and 1.11.0 is the actual version Signed-off-by: shubham --- pkg/version/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/version/util.go b/pkg/version/util.go index 0e4b848e..848bbdd3 100644 --- a/pkg/version/util.go +++ b/pkg/version/util.go @@ -6,9 +6,9 @@ import ( var ( validCurrentVersions = map[string]bool{ - "1.9.0": true, "1.10.0": true, + "1.9.0": true, "1.10.0": true, "1.11.0": true, } - validDesiredVersion = GetVersion() + validDesiredVersion = strings.Split(GetVersion(), "-")[0] ) // IsCurrentVersionValid verifies if the current version is valid or not