Skip to content

Wait for the deployment to create before status check - #43

Merged
masco merged 1 commit into
mainfrom
wait-deployment
Jul 1, 2026
Merged

masco merged 1 commit into
mainfrom
wait-deployment

Conversation

@masco

@masco masco commented Jul 1, 2026

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved observability operator setup reliability by adding a readiness check before continuing, reducing cases where later steps could fail because the deployment was not yet created.
    • Added a wait for the operator deployment to appear before checking that it becomes available.

Walkthrough

Adds a polling task to the bootstrap playbook that waits for the observability-operator deployment to be created in the openshift-operators namespace, running before the existing check that waits for the deployment to become Available.

Changes

Bootstrap readiness check

Layer / File(s) Summary
Wait for deployment creation
ansible/roles/bootstrap/tasks/main.yml
Adds a task polling oc get deployments/observability-operator -n openshift-operators with retries/delay until it succeeds, run before the existing wait for Available status.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Related Issues: None mentioned.

Related PRs: None mentioned.

Suggested labels: ansible, bootstrap

Suggested reviewers: None specified.

🐰 A rabbit hums while operators wake,
Polling gently till deployments take,
Ten seconds pass, then check again,
Thirty tries to ease the strain,
Then onward to "Available" state!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided, so relatedness to the changeset cannot be meaningfully assessed. Add a brief description of the bootstrap task change and why the extra deployment existence check is needed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: waiting for the deployment to exist before the status check.
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.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
ansible/roles/bootstrap/tasks/main.yml (1)

45-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add changed_when: false and use oc wait --for=create

This read-only probe should not mark the task changed, and the creation wait can be collapsed into a single oc wait call here.

♻️ Suggested simplification
-    - name: Wait for observability operator deployment to be created
-      shell: |
-        oc get deployments/observability-operator -n openshift-operators
-      register: obs_deploy
-      until: obs_deploy.rc == 0
-      retries: 30
-      delay: 10
+    - name: Wait for observability operator deployment to be created
+      shell: |
+        oc wait deployments/observability-operator --for=create --timeout=300s -n openshift-operators
+      changed_when: false
🤖 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 `@ansible/roles/bootstrap/tasks/main.yml` around lines 45 - 52, The
observability operator readiness check in the bootstrap task should be treated
as read-only and simplified. Update the task that uses obs_deploy so it does not
report changes by adding changed_when: false, and replace the current oc get
deployment polling with a single oc wait invocation using --for=create for
observability-operator in openshift-operators. Keep the retry/delay behavior
only if still needed around the wait command.

Source: Path instructions

🤖 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.

Nitpick comments:
In `@ansible/roles/bootstrap/tasks/main.yml`:
- Around line 45-52: The observability operator readiness check in the bootstrap
task should be treated as read-only and simplified. Update the task that uses
obs_deploy so it does not report changes by adding changed_when: false, and
replace the current oc get deployment polling with a single oc wait invocation
using --for=create for observability-operator in openshift-operators. Keep the
retry/delay behavior only if still needed around the wait command.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: e5948766-7814-43d4-9401-222f1b3c9c76

📥 Commits

Reviewing files that changed from the base of the PR and between aab4e97 and 97e7f47.

📒 Files selected for processing (1)
  • ansible/roles/bootstrap/tasks/main.yml

@masco
masco merged commit add25f9 into main Jul 1, 2026
2 checks passed
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.

1 participant