Skip to content

Commit

Permalink
fix(version): add version exceptions for upgrade ci (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
  • Loading branch information
shubham14bajpai authored Aug 3, 2021
1 parent eb6cfbf commit c9325ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions version/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
var (
minCurrentVersion = "2.6.0"
validDesiredVersion = strings.Split(Version, "-")[0]
// these are the versions used in various pipelines for ci testing
exceptions = []string{"master"}
)

// IsCurrentVersionValid verifies if the current version is valid or not
Expand All @@ -48,6 +50,11 @@ func CanCurrentVersionBeUpgraded(version string) bool {
func IsOldLessThanOrEqualNewVersion(old, new string) bool {
oldVersions := strings.Split(strings.Split(old, "-")[0], ".")
newVersions := strings.Split(strings.Split(new, "-")[0], ".")
for _, exception := range exceptions {
if newVersions[0] == exception {
return true
}
}
for i := 0; i < len(oldVersions); i++ {
oldVersion, _ := strconv.Atoi(oldVersions[i])
newVersion, _ := strconv.Atoi(newVersions[i])
Expand Down

0 comments on commit c9325ff

Please sign in to comment.