-
Notifications
You must be signed in to change notification settings - Fork 26
[SRVKP-7207] verify olmskiprange path #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
pkg/oc/oc.go
Outdated
| } | ||
| firstLine := lines[0] | ||
| pipelineVersion := os.Getenv("OPERATOR_VERSION") | ||
| if strings.Contains(firstLine, pipelineVersion) { |
There was a problem hiding this comment.
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
- for upgrade from 1.17.1 to 1.18.0
- 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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? 🤔
055558b to
e19bc7d
Compare
e19bc7d to
edd456e
Compare
edd456e to
823a57d
Compare
- 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
Validate OperatorVersion in OlmSkipRange for nightly



Validate OperatorVersion in OlmSkipRange for releases
Validate olm skiprange pre & post upgrade