Skip to content

Add readiness checks before running ocp-virt-validation-checkup - #83157

Open
orenc1 wants to merge 1 commit into
openshift:mainfrom
orenc1:stabilize_ove_abi_job
Open

Add readiness checks before running ocp-virt-validation-checkup#83157
orenc1 wants to merge 1 commit into
openshift:mainfrom
orenc1:stabilize_ove_abi_job

Conversation

@orenc1

@orenc1 orenc1 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Wait for ODF StorageClass and HCO CLI download route to be ready before starting the validation Job.
The StorageCluster can report Ready before all storage classes are created, and the HCO CLI download route may not be serving when the checkup tries to download virtctl, both causing immediate Job failures.

Summary by CodeRabbit

The disconnected bare-metal OVE validation job now waits for required dependencies before running ocp-virt-validation-checkup:

  • Waits up to 300 seconds for the ODF StorageClass after the StorageCluster becomes Ready.
  • Waits up to 120 seconds for the HCO CLI download route to return HTTP 200, 301, or 302 before downloading virtctl.
  • Skips the route check with a warning when the route is unavailable.

These checks reduce validation Job failures caused by delayed storage and HCO CLI availability.

Wait for ODF StorageClass and HCO CLI download route to be ready
before starting the validation Job. The StorageCluster can report
Ready before all storage classes are created, and the HCO CLI
download route may not be serving when the checkup tries to
download virtctl, both causing immediate Job failures.

Signed-off-by: Oren Cohen <ocohen@redhat.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The validation script now waits for the configured StorageClass and checks HCO CLI route readiness before continuing.

Changes

Validation readiness checks

Layer / File(s) Summary
StorageClass and HCO CLI readiness polling
ci-operator/step-registry/agent-qe/baremetal/install/ove/disconnected/run-validation-checkup/agent-qe-baremetal-install-ove-disconnected-run-validation-checkup-commands.sh
The script polls for the configured StorageClass for up to 300 seconds. It discovers the HCO CLI route and waits up to 120 seconds for an HTTP 200, 301, or 302 response. It skips the route check with a warning when the route is unavailable.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding readiness checks before running ocp-virt-validation-checkup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The pull request changes only a Bash command file; the diff adds no Ginkgo test declarations or test titles, so no unstable test name is introduced.
Test Structure And Quality ✅ Passed The pull request changes only one Bash script; it adds no Ginkgo test code, It blocks, or test fixtures to review against these requirements.
Microshift Test Compatibility ✅ Passed The pull request changes only a shell step and adds no Ginkgo tests or test constructs requiring MicroShift API compatibility review.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes only one shell script, adds no Go or Ginkgo e2e tests, and adds no It/Describe/Context/When declarations; SNO compatibility review is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The only changed file is a shell step; added lines wait for a StorageClass and HTTP route, and add no topology, affinity, replica, node-role, taint, or toleration constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes one shell orchestration script and no OTE binary or suite code; its echo output is outside the check's process-level binary scope.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch changes only a shell step and adds no Ginkgo e2e tests; the discovered HCO route is cluster-local and does not trigger this test-compatibility check.
No-Weak-Crypto ✅ Passed The PR adds only StorageClass and HTTPS route readiness checks; scans found no weak crypto, custom crypto, or secret/token comparisons.
Container-Privileges ✅ Passed The PR diff adds only StorageClass and route readiness checks; it introduces no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, or root settings.
No-Sensitive-Data-In-Logs ✅ Passed Added logs contain only StorageClass names, counters, and readiness status; the CLI route and curl output are suppressed, and no credentials, tokens, PII, or customer data are logged.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: orenc1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 10, 2026
@openshift-ci
openshift-ci Bot requested review from bmanzari and rlobillo August 10, 2026 06:40
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@orenc1: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
periodic-ci-openshift-eng-agent-qe-infra-release-4.21-amd64-nightly-baremetal-ove-compact N/A periodic Registry content changed

Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals.

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/agent-qe/baremetal/install/ove/disconnected/run-validation-checkup/agent-qe-baremetal-install-ove-disconnected-run-validation-checkup-commands.sh`:
- Around line 26-38: Update the HCO CLI route readiness loop around COUNTER to
track an explicit ROUTE_READY flag, set it only when the curl probe returns an
accepted status, and fail with a clear error after the 120-second deadline if it
remains unset. Ensure execution cannot continue into validation when the route
is unavailable.
- Line 28: Update the curl invocation in the route probe to include bounded
connection and total request timeouts, using values such as --connect-timeout 3
and --max-time 5, so stalled DNS, connection, TLS, or response operations cannot
delay retry counter progress.
🪄 Autofix

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: 9e43ee10-169d-4445-9bcf-568dfdcabc96

📥 Commits

Reviewing files that changed from the base of the PR and between 750f2a7 and 2879abf.

📒 Files selected for processing (1)
  • ci-operator/step-registry/agent-qe/baremetal/install/ove/disconnected/run-validation-checkup/agent-qe-baremetal-install-ove-disconnected-run-validation-checkup-commands.sh

Comment on lines +26 to +38
COUNTER=0
while [ $COUNTER -lt 120 ]; do
if curl -sk -o /dev/null -w '%{http_code}' "https://${CLI_ROUTE}/" 2>/dev/null | grep -qE '^(200|301|302)'; then
echo "HCO CLI download route is ready"
break
fi
sleep 10
COUNTER=$((COUNTER + 10))
echo "Waiting ${COUNTER}s for HCO CLI route to respond..."
done
else
echo "WARNING: HCO CLI download route not found, skipping readiness check"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Fail closed when the HCO CLI download route is not ready.

After COUNTER reaches 120, the loop exits and execution continues. No branch verifies that a probe succeeded. The validation flow can therefore proceed while the route still returns errors.

Track an explicit ROUTE_READY flag and exit with a clear error when the deadline expires. If continuing is intentional, make that fallback explicit and verify that the downstream validation flow supports it.

Proposed fix
   COUNTER=0
+  ROUTE_READY=false
   while [ $COUNTER -lt 120 ]; do
     if curl -sk -o /dev/null -w '%{http_code}' "https://${CLI_ROUTE}/" 2>/dev/null | grep -qE '^(200|301|302)'; then
+      ROUTE_READY=true
       echo "HCO CLI download route is ready"
       break
@@
     echo "Waiting ${COUNTER}s for HCO CLI route to respond..."
   done
+  if [[ "${ROUTE_READY}" != true ]]; then
+    echo "ERROR: HCO CLI download route did not become ready within 120s"
+    exit 1
+  fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
COUNTER=0
while [ $COUNTER -lt 120 ]; do
if curl -sk -o /dev/null -w '%{http_code}' "https://${CLI_ROUTE}/" 2>/dev/null | grep -qE '^(200|301|302)'; then
echo "HCO CLI download route is ready"
break
fi
sleep 10
COUNTER=$((COUNTER + 10))
echo "Waiting ${COUNTER}s for HCO CLI route to respond..."
done
else
echo "WARNING: HCO CLI download route not found, skipping readiness check"
fi
COUNTER=0
ROUTE_READY=false
while [ $COUNTER -lt 120 ]; do
if curl -sk -o /dev/null -w '%{http_code}' "https://${CLI_ROUTE}/" 2>/dev/null | grep -qE '^(200|301|302)'; then
ROUTE_READY=true
echo "HCO CLI download route is ready"
break
fi
sleep 10
COUNTER=$((COUNTER + 10))
echo "Waiting ${COUNTER}s for HCO CLI route to respond..."
done
if [[ "${ROUTE_READY}" != true ]]; then
echo "ERROR: HCO CLI download route did not become ready within 120s"
exit 1
fi
else
echo "WARNING: HCO CLI download route not found, skipping readiness check"
fi
🧰 Tools
🪛 ast-grep (0.45.0)

[warning] 27-27: curl is invoked with -k/--insecure, which disables TLS certificate verification and exposes the connection to man-in-the-middle attacks. Remove the insecure flag and let curl validate the server certificate; if you need to trust a private CA, pin it with --cacert instead.
Context: curl -sk -o /dev/null -w '%{http_code}' "https://${CLI_ROUTE}/"
Note: [CWE-295] Improper Certificate Validation.

(curl-insecure-tls-bash)

🤖 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/agent-qe/baremetal/install/ove/disconnected/run-validation-checkup/agent-qe-baremetal-install-ove-disconnected-run-validation-checkup-commands.sh`
around lines 26 - 38, Update the HCO CLI route readiness loop around COUNTER to
track an explicit ROUTE_READY flag, set it only when the curl probe returns an
accepted status, and fail with a clear error after the 120-second deadline if it
remains unset. Ensure execution cannot continue into validation when the route
is unavailable.

if [[ -n "${CLI_ROUTE}" ]]; then
COUNTER=0
while [ $COUNTER -lt 120 ]; do
if curl -sk -o /dev/null -w '%{http_code}' "https://${CLI_ROUTE}/" 2>/dev/null | grep -qE '^(200|301|302)'; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

curl_help="$(curl --help all)"
grep -q -- '--connect-timeout' <<<"${curl_help}"
grep -q -- '--max-time' <<<"${curl_help}"

Repository: openshift/release

Length of output: 155


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file='ci-operator/step-registry/agent-qe/baremetal/install/ove/disconnected/run-validation-checkup/agent-qe-baremetal-install-ove-disconnected-run-validation-checkup-commands.sh'

printf '%s\n' '--- target script ---'
cat -n "$file" | sed -n '1,90p'

printf '%s\n' '--- diff summary ---'
git diff --stat -- "$file"

printf '%s\n' '--- timeout and curl references ---'
rg -n -C 3 'curl|120|CLI_ROUTE|set -' "$file" ci-operator/step-registry/agent-qe/baremetal/install/ove/disconnected/run-validation-checkup

Repository: openshift/release

Length of output: 11763


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- curl timeout documentation ---'
curl --manual 2>/dev/null |
  grep -i -E -A 4 -B 4 'maximum time.*complete|default.*timeout|--max-time|--connect-timeout' |
  head -80

printf '%s\n' '--- no curl deadline: external timeout is required ---'
set +e
timeout 1s curl -sS -o /dev/null -w '%{http_code}' 'file:///dev/zero' >/tmp/curl-no-max-time.out 2>/dev/null
status_no_max_time=$?
set -e
printf 'status=%s output_bytes=%s\n' \
  "$status_no_max_time" "$(wc -c </tmp/curl-no-max-time.out)"

printf '%s\n' '--- curl max-time enforces a request deadline ---'
set +e
curl -sS --max-time 0.2 -o /dev/null -w '%{http_code}' 'file:///dev/zero' >/tmp/curl-max-time.out 2>/dev/null
status_max_time=$?
set -e
printf 'status=%s output_bytes=%s\n' \
  "$status_max_time" "$(wc -c </tmp/curl-max-time.out)"

test "$status_no_max_time" -eq 124
test "$status_max_time" -eq 28

Repository: openshift/release

Length of output: 190


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '--- curl without --max-time ---'
timeout 1s curl -sS -o /dev/null -w '%{http_code}' \
  'file:///dev/zero' >/tmp/curl-no-max-time.out 2>/dev/null
status_no_max_time=$?
printf 'status=%s output_bytes=%s\n' \
  "$status_no_max_time" "$(wc -c </tmp/curl-no-max-time.out)"

printf '%s\n' '--- curl with --max-time ---'
curl -sS --max-time 0.2 -o /dev/null -w '%{http_code}' \
  'file:///dev/zero' >/tmp/curl-max-time.out 2>/dev/null
status_max_time=$?
printf 'status=%s output_bytes=%s\n' \
  "$status_max_time" "$(wc -c </tmp/curl-max-time.out)"

test "$status_no_max_time" -eq 124
test "$status_max_time" -eq 28

Repository: openshift/release

Length of output: 267


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '--- curl without --max-time ---'
timeout 1s curl -sS -o /dev/null -w '%{http_code}' \
  'file:///dev/zero' >/tmp/curl-no-max-time.out 2>/dev/null
status_no_max_time=$?
printf 'status=%s output_bytes=%s\n' \
  "$status_no_max_time" "$(wc -c </tmp/curl-no-max-time.out)"

printf '%s\n' '--- curl with --max-time ---'
curl -sS --max-time 0.2 -o /dev/null -w '%{http_code}' \
  'file:///dev/zero' >/tmp/curl-max-time.out 2>/dev/null
status_max_time=$?
printf 'status=%s output_bytes=%s\n' \
  "$status_no_max_time" "$(wc -c </tmp/curl-no-max-time.out)"

test "$status_no_max_time" -eq 124
test "$status_max_time" -eq 28

Repository: openshift/release

Length of output: 268


🌐 Web query:

Official curl documentation --max-time default zero --connect-timeout timeout

💡 Result:

In curl, the --max-time option has no default timeout; it effectively defaults to zero, meaning there is no time limit on the operation [1]. When --max-time is set (or left at its default of zero), curl will allow the operation to continue indefinitely until completion or until another network-related error occurs [1]. Regarding --connect-timeout, this option limits only the connection phase, which includes DNS lookup and TCP, TLS, or QUIC handshakes [2][3]. If curl does not successfully connect within the time specified by --connect-timeout, it will exit with a timeout error (exit code 28) [3][4]. There is no default "timeout" value for --connect-timeout that forces a connection to fail; if the option is not used, curl relies on the operating system's default connection timeout [1][5]. Both options accept decimal values for sub-second precision (e.g., --max-time 0.5 or --connect-timeout 2.781) [1][5][4].

Citations:


Bound each route probe.

The retry counter advances only after curl returns. Without a default operation timeout, a stalled DNS lookup, connection, TLS handshake, or response can exceed the intended 120-second limit. Add per-request --connect-timeout and --max-time values, such as --connect-timeout 3 --max-time 5.

🤖 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/agent-qe/baremetal/install/ove/disconnected/run-validation-checkup/agent-qe-baremetal-install-ove-disconnected-run-validation-checkup-commands.sh`
at line 28, Update the curl invocation in the route probe to include bounded
connection and total request timeouts, using values such as --connect-timeout 3
and --max-time 5, so stalled DNS, connection, TLS, or response operations cannot
delay retry counter progress.

@orenc1

orenc1 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-eng-agent-qe-infra-release-4.21-amd64-nightly-baremetal-ove-compact

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@orenc1: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@orenc1: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/periodic-ci-openshift-eng-agent-qe-infra-release-4.21-amd64-nightly-baremetal-ove-compact 2879abf link unknown /pj-rehearse periodic-ci-openshift-eng-agent-qe-infra-release-4.21-amd64-nightly-baremetal-ove-compact

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@orenc1

orenc1 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-eng-agent-qe-infra-release-4.21-amd64-nightly-baremetal-ove-compact

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@orenc1: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant