Commit 2c747298 authored by Derek Nola's avatar Derek Nola Committed by Brad Davidson

Fix skew semver for release-XX branches (#11531)

Signed-off-by: 's avatarDerek Nola <derek.nola@suse.com> (cherry picked from commit 67ffd2ab) Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent cca8faca
...@@ -33,7 +33,7 @@ var _ = BeforeSuite(func() { ...@@ -33,7 +33,7 @@ var _ = BeforeSuite(func() {
// For master and unreleased branches, we want the latest stable release // For master and unreleased branches, we want the latest stable release
var upgradeChannel string var upgradeChannel string
var err error var err error
if *branch == "master" || *branch == "release-v1.32" { if *branch == "master" || *branch == "release-1.32" {
// disabled: AuthorizeNodeWithSelectors is now on by default, which breaks compat with agents < v1.32. // disabled: AuthorizeNodeWithSelectors is now on by default, which breaks compat with agents < v1.32.
// This can be ren-enabled once the previous branch is v1.32 or higher, or when RBAC changes have been backported. // This can be ren-enabled once the previous branch is v1.32 or higher, or when RBAC changes have been backported.
// ref: https://github.com/kubernetes/kubernetes/pull/128168 // ref: https://github.com/kubernetes/kubernetes/pull/128168
...@@ -44,10 +44,10 @@ var _ = BeforeSuite(func() { ...@@ -44,10 +44,10 @@ var _ = BeforeSuite(func() {
upgradeChannel = strings.Replace(*branch, "release-", "v", 1) upgradeChannel = strings.Replace(*branch, "release-", "v", 1)
// now that it is in v1.1 format, we want to substract one from the minor version // now that it is in v1.1 format, we want to substract one from the minor version
// to get the previous release // to get the previous release
sV, err := semver.Parse(upgradeChannel) sV, err := semver.ParseTolerant(upgradeChannel)
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred(), "failed to parse version from "+upgradeChannel)
sV.Minor-- sV.Minor--
upgradeChannel = sV.String() upgradeChannel = fmt.Sprintf("v%d.%d", sV.Major, sV.Minor)
} }
lastMinorVersion, err = tester.GetVersionFromChannel(upgradeChannel) lastMinorVersion, err = tester.GetVersionFromChannel(upgradeChannel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment