NE-2215: add CI step and nightly job for testing previous HAProxy version#80171
NE-2215: add CI step and nightly job for testing previous HAProxy version#80171gcs278 wants to merge 1 commit into
Conversation
Add a CI step and nightly job definitions for testing multiple HAProxy versions. This supports the HAProxy version selection feature described in openshift/enhancements#1965. The step (ingress-conf-haproxy-version) auto-discovers HAProxy sidecar images from the release payload and configures the default IngressController to use a specific version at install time. Two job definitions are included (both commented out pending EP decisions on API field name and default version behavior): - e2e-aws-ovn-haproxy-previous-techpreview - e2e-aws-ovn-haproxy-newest-techpreview TODOs: - Finalize API field name (haproxyVersion vs haproxyOCPVersion) - Determine default version behavior (current vs previous on upgrade) - Uncomment the appropriate job once decisions are made Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@gcs278: This pull request references NE-2215 which is a valid jira issue. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
WalkthroughThis PR introduces a new reusable CI step for configuring OpenShift IngressController HAProxy versions. The step supports explicit version injection or automatic discovery from release payloads, with new job templates demonstrating integration patterns. ChangesHAProxy Version Configuration Step
🎯 2 (Simple) | ⏱️ ~12 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gcs278 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] Note: If this PR includes changes to step registry files ( |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@ci-operator/step-registry/ingress/conf/haproxy-version/ingress-conf-haproxy-version-commands.sh`:
- Around line 26-50: The current pipeline that builds HAPROXY_IMAGES uses plain
lexicographic sort which misorders multi-digit tags; change the pipeline that
sets HAPROXY_IMAGES to use version-aware sorting (e.g., replace the plain sort
with a version-aware sort such as sort -V or sort -t- -k2,2V) so that selecting
TARGET_IMAGE for HAPROXY_AUTO_SELECT (in the case branches that use head/tail)
picks the true previous/newest semantic version; keep the rest of the logic (the
grep '^haproxy-' filter, COUNT check, and HAPROXY_AUTO_SELECT case) the same.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: b987fb87-db29-4eae-ab43-fe063a7c4c7a
📒 Files selected for processing (5)
ci-operator/config/openshift/release/openshift-release-main__nightly-5.0.yamlci-operator/step-registry/ingress/conf/haproxy-version/OWNERSci-operator/step-registry/ingress/conf/haproxy-version/ingress-conf-haproxy-version-commands.shci-operator/step-registry/ingress/conf/haproxy-version/ingress-conf-haproxy-version-ref.metadata.jsonci-operator/step-registry/ingress/conf/haproxy-version/ingress-conf-haproxy-version-ref.yaml
| HAPROXY_IMAGES=$(oc adm release info --registry-config "${CLUSTER_PROFILE_DIR}/pull-secret" \ | ||
| "${RELEASE_IMAGE_LATEST}" --output=json | \ | ||
| jq -r '.references.spec.tags[].name' | grep '^haproxy-' | sort || true) | ||
|
|
||
| if [[ -z "${HAPROXY_IMAGES}" ]]; then | ||
| echo "No HAProxy sidecar images found in payload, skipping" | ||
| exit 0 | ||
| fi | ||
|
|
||
| COUNT=$(echo "${HAPROXY_IMAGES}" | wc -l) | ||
| echo "Found ${COUNT} HAProxy image(s) in payload: ${HAPROXY_IMAGES}" | ||
|
|
||
| if [[ "${COUNT}" -lt 2 ]]; then | ||
| echo "Only one HAProxy version in payload, no alternative version to test. Skipping." | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Image names follow the pattern "haproxy-28", "haproxy-32", etc. | ||
| case "${HAPROXY_AUTO_SELECT}" in | ||
| previous) | ||
| TARGET_IMAGE=$(echo "${HAPROXY_IMAGES}" | head -1) | ||
| ;; | ||
| newest) | ||
| TARGET_IMAGE=$(echo "${HAPROXY_IMAGES}" | tail -1) | ||
| ;; |
There was a problem hiding this comment.
Use version-aware ordering before selecting previous/newest.
Line 28 uses lexicographic sort, which can select the wrong image when tags include multi-digit components (for example, haproxy-310 vs haproxy-39).
💡 Proposed fix
- HAPROXY_IMAGES=$(oc adm release info --registry-config "${CLUSTER_PROFILE_DIR}/pull-secret" \
- "${RELEASE_IMAGE_LATEST}" --output=json | \
- jq -r '.references.spec.tags[].name' | grep '^haproxy-' | sort || true)
+ HAPROXY_IMAGES=$(oc adm release info --registry-config "${CLUSTER_PROFILE_DIR}/pull-secret" \
+ "${RELEASE_IMAGE_LATEST}" --output=json | \
+ jq -r '.references.spec.tags[].name | select(startswith("haproxy-"))' | sort -V || true)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@ci-operator/step-registry/ingress/conf/haproxy-version/ingress-conf-haproxy-version-commands.sh`
around lines 26 - 50, The current pipeline that builds HAPROXY_IMAGES uses plain
lexicographic sort which misorders multi-digit tags; change the pipeline that
sets HAPROXY_IMAGES to use version-aware sorting (e.g., replace the plain sort
with a version-aware sort such as sort -V or sort -t- -k2,2V) so that selecting
TARGET_IMAGE for HAPROXY_AUTO_SELECT (in the case branches that use head/tail)
picks the true previous/newest semantic version; keep the rest of the logic (the
grep '^haproxy-' filter, COUNT check, and HAPROXY_AUTO_SELECT case) the same.
Summary
Adds a CI step and nightly job definitions to test the previous HAProxy version on the default IngressController. This supports the HAProxy version selection feature described in openshift/enhancements#1965.
What's included
CI step (
ingress-conf-haproxy-version): Inspects the release payload for HAProxy sidecar images viaoc adm release infoand configures the default IngressController to use a specific version at install time by writing a manifest toSHARED_DIR. Supports both explicit version selection (HAPROXY_VERSION) and auto-discovery (HAPROXY_AUTO_SELECT: "previous"or"newest"). If only one HAProxy version exists in the payload, the step exits cleanly (no-op).Nightly job definitions (commented out pending EP decisions): Two job variants for
e2e-aws-ovnwithTechPreviewNoUpgrade:e2e-aws-ovn-haproxy-previous-techpreview— installs with the oldest HAProxy version in the payloade2e-aws-ovn-haproxy-newest-techpreview— installs with the newest HAProxy version in the payloadOnly one job is needed — which one depends on the default version decision in the EP. The base
e2e-aws-ovnjob already tests whatever the default is, so we only need one additional job for the non-default version.Pending EP decisions
haproxyVersion(HAProxy-version based) vshaproxyOCPVersion(OCP-version based)How it works
HAPROXY_AUTO_SELECT: "previous"(or"newest")oc adm release infoagainst the payload to discoverhaproxy-*imagesSHARED_DIRPrior art
Follows the same pattern as RHCOS dual-stream testing:
rhcos-conf-osstreamdiscovers and configures the OS versione2e-aws-ovn-rhcos10-techpreviewtests the non-default OS varianthttps://redhat.atlassian.net/browse/NE-2215
🤖 Generated with Claude Code