Fix VPN cert rotation flag collision between concurrent slices#389
Open
Ady0333 wants to merge 1 commit into
Open
Fix VPN cert rotation flag collision between concurrent slices#389Ady0333 wants to merge 1 commit into
Ady0333 wants to merge 1 commit into
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>
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
VpnKeyRotationServiceis a singleton. The oldjobCreationInProgress atomic.Boolwasprocess-global shared across every slice reconcile. When slice-A triggered cert jobs and set the
flag to
true, slice-B's reconcile would skiptriggerJobsForCertCreationentirely and fallthrough to
verifyAllJobsAreCompleted. Since old Jobs from slice-B's prior rotation are neverdeleted, they'd return
JobStatusComplete, causing the reconciler to advanceCertificateExpiryTimeand incrementRotationCountfor slice-B without generating any newcerts. No error, no event indicating failure.
Before (broken):
After (fixed):
How Has This Been Tested?
with expired certs sequentially on the same singleton service instance
wg.AssertNumberOfCalls(t, "GenerateCerts", 2)
Checklist:
Does this PR introduce a breaking change for other components like worker-operator?
No breaking changes. The fix is internal to the controller's rotation state tracking.