fix: reconcile ListenerSet when referenced TLS Secret changes - #9634
Open
zanarellidev wants to merge 3 commits into
Open
fix: reconcile ListenerSet when referenced TLS Secret changes#9634zanarellidev wants to merge 3 commits into
zanarellidev wants to merge 3 commits into
Conversation
Signed-off-by: zanarelli <zanarelli.dev@gmail.com>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9634 +/- ##
==========================================
+ Coverage 76.04% 76.07% +0.03%
==========================================
Files 259 259
Lines 43275 43319 +44
==========================================
+ Hits 32907 32957 +50
+ Misses 8178 8172 -6
Partials 2190 2190 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Mirror isGatewayReferencingSecret by checking that every ListenerSet indexed by a TLS Secret belongs to a Gateway managed by this controller. Signed-off-by: zanarelli <zanarelli.dev@gmail.com>
zirain
previously approved these changes
Aug 2, 2026
arkodg
reviewed
Aug 3, 2026
| return false | ||
| } | ||
|
|
||
| for i := range lsList.Items { |
Contributor
There was a problem hiding this comment.
we return false for 1 bad parentRef instead of finding any valid secrets that need to be reconciled
this bug exists in another place
diff --git a/internal/provider/kubernetes/predicates.go b/internal/provider/kubernetes/predicates.go
--- a/internal/provider/kubernetes/predicates.go
+++ b/internal/provider/kubernetes/predicates.go
@@ -388,11 +388,11 @@ func (r *gatewayAPIReconciler) isGatewayReferencingSecret(nsName *types.Namespa
for i := range gwList.Items {
gw := &gwList.Items[i]
- if !r.validateGatewayForReconcile(gw) {
- return false
+ if r.validateGatewayForReconcile(gw) {
+ return true
}
}
- return true
+ return false
}
func (r *gatewayAPIReconciler) isListenerSetReferencingSecret(nsName *types.NamespacedName) bool {
@@ -419,12 +419,12 @@ func (r *gatewayAPIReconciler) isListenerSetReferencingSecret(nsName *types.Nam
if err := r.client.Get(context.Background(), key, gw); err != nil {
r.log.Error(err, "failed to get parent Gateway for ListenerSet",
"namespace", ls.Namespace, "name", ls.Name)
- return false
+ continue
}
- if !r.validateGatewayForReconcile(gw) {
- return false
+ if r.validateGatewayForReconcile(gw) {
+ return true
}
}
- return true
+ return false
}
can this be addressed ?
isGatewayReferencingSecret and isListenerSetReferencingSecret returned false as soon as any unmanaged or missing parent appeared, so a valid Gateway/ListenerSet sharing the same TLS Secret never reconciled. Return true on the first managed parent; continue past Get errors and unmanaged gateways. Cover mixed valid/invalid parents in unit tests. Signed-off-by: zanarelli <zanarelli.dev@gmail.com>
Author
|
Applied in 6569e5a: both secret predicates now return true on the first managed parent and continue past a missing/unmanaged one. Added mixed valid/invalid parent unit coverage. |
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.
What this PR does / why we need it:
validateSecretForReconcileindexed Secrets referenced by Gateways (and other policies) but not byListenerSetcertificateRefs. After #9488 fixed #9486 and stopped treating every Secret as relevant, creating or renewing a TLS Secret for a ListenerSet no longer triggered reconcile, so the ListenerSet could stayProgrammed=False(typical cert-manager flow).This adds a
secretListenerSetIndex, wires it into the ListenerSet indexers and the offline controller client, and includes ListenerSet refs in the Secret predicate (gated onlistenerSetCRDExists).Which issue(s) this PR fixes:
Fixes #9614
PR Checklist
git commit -s). See DCO: Sign your work.go test ./internal/provider/kubernetes/ -run 'TestValidateSecretForReconcile|TestOfflineGatewayAPIController'). Fullmake generate gen-check/make lint/ coverage left to CI.TestValidateSecretForReconcileand registeredsecretListenerSetIndexin the offline controller index smoke test.release-notes/current/bug_fixes/9614-listenerset-secret-reconcile.md.