Unify version checks in pre-config and install steps for 4.N to 5.N compatibility#77356
Unify version checks in pre-config and install steps for 4.N to 5.N compatibility#77356jianlinliu wants to merge 2 commits intoopenshift:mainfrom
Conversation
|
/pj-rehearse periodic-ci-openshift-verification-tests-main-installation-nightly-4.16-azure-ipi-vmgenv2-f28 periodic-ci-openshift-verification-tests-main-installation-nightly-4.16-gcp-upi-xpn-f28 periodic-ci-openshift-openshift-tests-private-release-4.23-multi-nightly-aws-upi-basecap-none-arm-f7 periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-stable-aws-ipi-disc-priv-localzone-fips-f28 periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-stable-aws-c2s-ipi-disc-priv-fips-f28 periodic-ci-openshift-openshift-tests-private-release-4.20-multi-stable-aws-ipi-proxy-sts-arm-f28 periodic-ci-openshift-openshift-tests-private-release-5.0-multi-nightly-azure-ipi-sharednetwork-public-to-private-arm-f28 |
|
@jianlinliu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
1a96102 to
582f5db
Compare
…ompatibility Replace arithmetic version comparisons with sort -V based functions in configuration steps that run before ipi-install-install. Changes: - Add inline version comparison functions (version_ge, version_gt, version_le, version_lt) to 25 pre-configuration command scripts - Replace arithmetic comparisons like (( major == 4 && minor >= 12 )) with semantic version comparisons using sort -V - Remove major/minor version extraction where no longer needed - Replace custom version check functions in GCP files with standardized version_ge function - Update inactive/commented code to follow the same pattern This ensures version comparisons work correctly across major version boundaries (e.g., comparing 5.0 with 4.20). Files updated: - AWS: 9 files (c2s, cluster, provision, ipi/conf, upi) - Azure: 6 files (cluster, provision, ipi/conf) - GCP: 4 files (provision, upi, ipi/conf) - IPI: 3 files (capability, manual-creds, network) - Other: 3 files (edge-nodes, enable-qe-catalogsource) Related: openshift#73626
582f5db to
c42cf76
Compare
|
/pj-rehearse periodic-ci-openshift-verification-tests-main-installation-nightly-4.16-azure-ipi-vmgenv2-f28 periodic-ci-openshift-verification-tests-main-installation-nightly-4.16-gcp-upi-xpn-f28 periodic-ci-openshift-openshift-tests-private-release-4.23-multi-nightly-aws-upi-basecap-none-arm-f7 periodic-ci-openshift-openshift-tests-private-release-4.19-amd64-stable-aws-ipi-disc-priv-localzone-fips-f28 periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-stable-aws-c2s-ipi-disc-priv-fips-f28 periodic-ci-openshift-openshift-tests-private-release-4.20-multi-stable-aws-ipi-proxy-sts-arm-f28 periodic-ci-openshift-openshift-tests-private-release-5.0-multi-nightly-azure-ipi-sharednetwork-public-to-private-arm-f28 |
|
@jianlinliu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
It seems olmv1-disable-default-clustercatalogs also need this fix? |
lvms-catalogsource seems to need it as well? cc @Xia-Zhao-rh |
Easy fix, I will fix it after the 1st round of rehearse completed.
It is a easy fix, is there anyone help approve the change ? |
after it is fixed, I can add lgtm. |
Do you have approval permission on |
|
/pj-rehearse periodic-ci-openshift-verification-tests-main-installation-nightly-4.16-gcp-upi-xpn-f28 |
|
@jianlinliu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
No. I can only add lgtm. |
How about I only update |
ok for me. |
@mgencur FYI. it seems you add the code disable_default_catalogsource in lvms-catalogsource.sh. it needs the fix as this PR. |
Replace arithmetic version comparison with semantic version comparison
to properly handle major version boundary crossing (4.N to 5.N).
Changes:
- Add version_gt function using sort -V
- Replace [[ "X${major_version}" == "X4" && -n "${minor_version}" && "${minor_version}" -gt 17 ]]
with version_gt "${ocp_version}" "4.17"
- Remove unused major_version and minor_version variable extractions
- Simplify ocp_version extraction to directly get X.Y format
This ensures the OLMv1 default clustercatalog disabling works correctly
for versions > 4.17, including 5.0+.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jianlinliu The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
[REHEARSALNOTIFIER]
A total of 28480 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs. A full list of affected jobs can be found here Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
/pj-rehearse periodic-ci-openshift-openshift-tests-private-release-4.17-amd64-stable-aws-c2s-ipi-disc-priv-fips-f28 periodic-ci-openshift-openshift-tests-private-release-4.22-amd64-nightly-baremetalds-ipi-ovn-ipv6-fips-f14 periodic-ci-openshift-openshift-tests-private-release-4.22-multi-nightly-azure-ipi-oidc-mini-perm-arm-f7 |
|
@jianlinliu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
@jianlinliu: job(s): either don't exist or were not found to be affected, and cannot be rehearsed |
|
@jianlinliu: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
This PR unifies version comparison logic in pre-configuration, install, and post-install steps to ensure compatibility with OpenShift major version transitions (4.N to 5.N).
Changes
sort -Vbased version comparison functions to 26 command scripts(( major == 4 && minor >= 12 ))with semantic version comparisons (e.g.,version_ge "${ocp_version}" "4.12")ocp_major_versionandocp_minor_versionvariable extractions where no longer neededversion_gefunctionFiles Updated (26 total)
AWS (9 files)
Azure (6 files)
GCP (4 files)
IPI Configuration (3 files)
OLMv1 (1 file)
Other (3 files)
Why This Matters
Arithmetic comparisons fail across major version boundaries:
(( 5 == 4 && 0 >= 12 ))evaluates to false (incorrect)version_ge "5.0" "4.12"usingsort -Vevaluates to true (correct)Testing
sort -Vfor proper semantic version comparisonRelated