fix(): Missing cluster silently skips gateway creation, leaving slice with no inter-cluster connectivity#390
Open
Ady0333 wants to merge 2 commits into
Open
Conversation
Make jobCreationInProgress per-slice instead of process-global to prevent one slice's certificate rotation from blocking another's. Replace atomic.Bool with sync.Map keyed by namespace/sliceName. Also fixes pre-existing broken test type hints (util.Client -> client.Client). Signed-off-by: Ady0333 <adityashinde1525@gmail.com>
Return an error when a referenced Cluster CR is not found, instead of silently returning nil. This ensures the SliceConfig is requeued by the work queue until the cluster is registered, preventing ghost slices with no inter-cluster connectivity. Signed-off-by: Ady0333 <adityashinde1525@gmail.com>
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.
Description
createMinimumGatewaysIfNotExists()queries each cluster referenced inSliceConfig.Spec.Clustersto build the gateway mesh. When a
ClusterCR is absent,util.GetResourceIfExist()returns(false, nil). The original code checkedif !found || err != nil { return ctrl.Result{}, err }—when
!found==trueanderr==nil, this returnsnilto the work queue.Before (broken):
The SliceConfig reconcile sees nil, treats it as success, and drops from the work queue. Meanwhile,
the earlier CreateMinimalWorkerSliceConfig step already created WorkerSliceConfig objects for all
clusters (it doesn't validate cluster existence). The slice is now in a ghost state: worker configs
exist, but the gateway mesh is never built zero cross-cluster connectivity.
How Has This Been Tested?
Cluster CR during gateway creation
Checklist:
Does this PR introduce a breaking change for other components like worker-operator?
No breaking changes. The fix makes error handling stricter only affects behavior when a referenced Cluster is missing (previously silent, now properly requeued).
-->