Skip to content

Fix/update annotations conflict retry#570

Merged
bsquizz merged 1 commit intomainfrom
fix/update-annotations-conflict-retry
Apr 21, 2026
Merged

Fix/update annotations conflict retry#570
bsquizz merged 1 commit intomainfrom
fix/update-annotations-conflict-retry

Conversation

@bsquizz
Copy link
Copy Markdown
Contributor

@bsquizz bsquizz commented Apr 21, 2026

Summary

Fixes a conflict race on the initial cl.Update in UpdateNamespaceResources that caused no-ClowdEnvironment pools (e.g. rosa) to stay empty after the UpdateAnnotations fix in #568.

After namespace creation, OpenShift controllers (Tekton, OLM, workload-monitoring) immediately update the namespace, advancing its resource version. The subsequent update to set the pool label, env-status: creating, and the ownerRef then fails with a conflict. With no retry, the namespace is deleted — but since it never received the pool label, its deletion does not trigger the EnqueueNamespace watcher. The pool controller stops reconciling and the pool stays perpetually empty.

Wraps the initial fetch+update in RetryOnConflict, re-fetching the namespace inside the retry callback so each attempt uses the current resource version.

Test plan

🤖 Generated with Claude Code

…date

The same OpenShift controller race that broke UpdateAnnotations also
affects the initial cl.Update in UpdateNamespaceResources. Immediately
after namespace creation, controllers (Tekton, OLM, workload-monitoring)
update the namespace, advancing its resource version. The subsequent
update to set labels, annotations, and the ownerRef then fails with a
conflict. With no retry, the namespace is deleted and the pool tries
again, but the deleted namespace had no pool label so its deletion never
re-triggers the EnqueueNamespace watcher — leaving the pool stuck with
ready=0 and no further reconcile.

Wrap the initial fetch+update in RetryOnConflict, re-fetching the
namespace on each attempt so the resource version stays current.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@bsquizz bsquizz force-pushed the fix/update-annotations-conflict-retry branch from 845f1b9 to 409eac3 Compare April 21, 2026 20:38
@bsquizz bsquizz merged commit f38492a into main Apr 21, 2026
5 of 6 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