Skip to content

Conversation

@manthinasai
Copy link
Collaborator

@manthinasai manthinasai commented Apr 17, 2025

Validate OperatorVersion in OlmSkipRange for nightly
Screenshot From 2025-08-12 15-17-46
Validate OperatorVersion in OlmSkipRange for releases
Screenshot From 2025-08-12 15-21-55
Validate olm skiprange pre & post upgrade
image

pkg/oc/oc.go Outdated
}
firstLine := lines[0]
pipelineVersion := os.Getenv("OPERATOR_VERSION")
if strings.Contains(firstLine, pipelineVersion) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for upgrade, there are two cases

  1. for upgrade from 1.17.1 to 1.18.0
  2. if there is a minor release (for eg: 1.16.4 -> 1.17.1) it would show as 1.16.4 -> 1.17.0 and 1.17.0 -> 1.17.1. could you check this?

pkg/oc/oc.go Outdated
firstLine := lines[0]
pipelineVersion := os.Getenv("OPERATOR_VERSION")
if strings.Contains(firstLine, pipelineVersion) {
log.Printf("Success: OPERATOR_VERSION '%s' matches the first line of OLM Skip Range: '%s'", pipelineVersion, firstLine)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand it correctly, first line refers to the channel latest. Is the order of lines guaranteed? I am not sure. IMHO it would be much safer to get data in format similar to this one

latest >=1.18.0 <5.0.5-593
pipelines-1.14 >=1.13.0 <1.14.6
pipelines-1.15 >=1.14.0 <1.15.2
pipelines-1.16 >=1.16.0 <1.16.3
pipelines-1.17 >=1.17.0 <1.17.1
pipelines-1.18 >=1.17.0 <1.18.0
pipelines-5.0 >=1.18.0 <5.0.5-593

pkg/oc/oc.go Outdated
preUpgradeSkipRange, preExists := skipRangeData[preUpgradeSkipRange]
postUpgradeSkipRange, postExists := skipRangeData[postUpgradeSkipRange]
if !preExists || !postExists || preUpgradeSkipRange == "" || postUpgradeSkipRange == "" {
log.Printf("Error: One of the skip ranges is missing or empty. Pre-Upgrade: %v, Post-Upgrade: %v", preUpgradeSkipRange, postUpgradeSkipRange)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need log.Printf when it's followed by testsuit.T.Fail

pkg/oc/oc.go Outdated
}
log.Printf("Pre-Upgrade Skip Range: %v", preUpgradeSkipRange)
log.Printf("Post-Upgrade Skip Range: %v", postUpgradeSkipRange)
if preUpgradeSkipRange == postUpgradeSkipRange {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this condition... shouldn't equality of annotation mean what something is wrong? 🤔

- Added extractMajorMinor function to extract major.minor from full version
- Fixed channel name matching to use major.minor (e.g., 1.19.2 -> 1.19)
- Channel pipelines-1.19 now correctly matches OSP_VERSION 1.19.2
- Updated error messages to show both full version and major.minor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants