Wait for the deployment to create before status check - #43
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a polling task to the bootstrap playbook that waits for the ChangesBootstrap readiness check
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, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ansible/roles/bootstrap/tasks/main.yml (1)
45-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd
changed_when: falseand useoc wait --for=createThis read-only probe should not mark the task changed, and the creation wait can be collapsed into a single
oc waitcall 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
📒 Files selected for processing (1)
ansible/roles/bootstrap/tasks/main.yml
No description provided.