Merged
Conversation
…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]>
845f1b9 to
409eac3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a conflict race on the initial
cl.UpdateinUpdateNamespaceResourcesthat caused no-ClowdEnvironment pools (e.g.rosa) to stay empty after theUpdateAnnotationsfix 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
poollabel,env-status: creating, and the ownerRef then fails with a conflict. With no retry, the namespace is deleted — but since it never received thepoollabel, its deletion does not trigger theEnqueueNamespacewatcher. 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
make fmt vet— cleanmake test— 93/93 tests pass (53 helper + 40 controller)🤖 Generated with Claude Code