Skip to content

fix: retry image-update writes in Eventually to handle 409 Conflict i… - #3

Merged
gitcommitankit merged 1 commit into
mainfrom
fix/github-ci
Aug 6, 2026
Merged

fix: retry image-update writes in Eventually to handle 409 Conflict i…#3
gitcommitankit merged 1 commit into
mainfrom
fix/github-ci

Conversation

@gitcommitankit

@gitcommitankit gitcommitankit commented Aug 6, 2026

Copy link
Copy Markdown
Owner

…n CI

The reconciler can modify the AgentDeployment (finalizer add, status write) between the test's Get and Update, bumping the resourceVersion. The resulting 409 Conflict was flaking the 'does not advance StableVersion during a partial rollout' test (and would also flake 'updates the child Deployment image').

Fix: wrap the Get+Update block in Eventually so the test transparently retries on conflict — the standard controller-runtime envtest idiom for this pattern.

Summary by CodeRabbit

  • Tests
    • Improved reliability of image-change tests by retrying Kubernetes resource reads and updates when temporary conflicts occur.
    • Ensured deployment status is settled before establishing test baselines.

…n CI

The reconciler can modify the AgentDeployment (finalizer add, status write)
between the test's Get and Update, bumping the resourceVersion. The resulting
409 Conflict was flaking the 'does not advance StableVersion during a partial
rollout' test (and would also flake 'updates the child Deployment image').

Fix: wrap the Get+Update block in Eventually so the test transparently retries
on conflict — the standard controller-runtime envtest idiom for this pattern.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 38088712-435c-4974-b249-7fc4ffb6b08a

📥 Commits

Reviewing files that changed from the base of the PR and between cb0934c and f9c8015.

📒 Files selected for processing (1)
  • internal/controller/agentdeployment_controller_test.go

📝 Walkthrough

Walkthrough

The controller tests now wait for settled status values and retry AgentDeployment image updates after refetching resources. This handles resource-version conflicts during Kubernetes test operations.

Changes

AgentDeployment test resilience

Layer / File(s) Summary
Retry image updates and capture settled status
internal/controller/agentdeployment_controller_test.go
Image updates now run through Eventually with fresh reads and retries. Stable-version checks capture Status.StableVersion only after the object settles.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes retrying image-update writes with Eventually to handle 409 Conflict errors, which matches the main change.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/github-ci

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

@gitcommitankit
gitcommitankit merged commit 351369a into main Aug 6, 2026
4 checks passed
@gitcommitankit
gitcommitankit deleted the fix/github-ci branch August 15, 2026 19:03
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