Skip to content

Commit

Permalink
OCM-11135 | ci: Fix id:67414
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Sep 13, 2024
1 parent a5c17f1 commit d5b0263
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/e2e/test_rosacli_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ var _ = Describe("Edit nodepool",
versionList, err := versionService.ListAndReflectVersions(clusterChannelGroup, false)
Expect(err).ToNot(HaveOccurred())

clusterSemVer := semver.MustParse(clusterVersion)
var lVersion string = clusterVersion
var upgradeVersion string
for {
Expand All @@ -685,7 +686,15 @@ var _ = Describe("Edit nodepool",
lVersion = lowerVersion.Version
if lowerVersion.AvailableUpgrades != "" {
upgrades := common.ParseCommaSeparatedStrings(lowerVersion.AvailableUpgrades)
upgradeVersion = upgrades[len(upgrades)-1]

// We need to find the biggest upgradeVersion which is lower or equal to clusterVersion
for i := len(upgrades) - 1; i < 0; i-- {
upgradeVersion = upgrades[i]
upSemVer := semver.MustParse(upgradeVersion)
if upSemVer.LessThan(clusterSemVer) || upSemVer.Equal(clusterSemVer) {
break
}
}
break
}
Logger.Debugf("The lower version %s has no available upgrades continue to find next one\n", lVersion)
Expand All @@ -694,7 +703,9 @@ var _ = Describe("Edit nodepool",
Logger.Warn("Cannot find a version with available upgrades")
return
}

Logger.Infof("Using previous version %s", lVersion)
Logger.Infof("Final upgrade version should be %s", upgradeVersion)

By("Prepare a node pool with optional-1 version with manual upgrade")
nodePoolManualName := common.GenerateRandomName("np-67414", 2)
Expand Down

0 comments on commit d5b0263

Please sign in to comment.