-
Notifications
You must be signed in to change notification settings - Fork 607
fix(translator): check gateway class and do not skip listeners when gateway class is not managed by KIC #7666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ot managed by KIC
9016641
to
915a344
Compare
// Check if listener is marked as programmed when the gateway is controlled by KIC in its spec and has the "Unmanaged" annotation. | ||
// If the GatewayClass is does not satify the condition, the gateway is considered to be managed by other components (for example Kong Oprator), | ||
// So we do not check the "Programmed" condition before extracting the certificate from the listener. | ||
if gwc.Spec.ControllerName == gatewayapi.GatewayController(t.gatewayControllerName) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REVIEW: should we check controller name here or just check the unmanaged
annotation?
@@ -440,6 +441,11 @@ func (r *GatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct | |||
debug(log, gateway, "Ensured gateway was removed from the data-plane (if ever present)") | |||
return ctrl.Result{}, nil | |||
} | |||
err := r.DataplaneClient.UpdateObject(gwc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REVIEW: Should we store the gatewayclass into translator cache here or in the gateway class controller?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7666 +/- ##
=====================================
Coverage 77.2% 77.3%
=====================================
Files 222 222
Lines 25870 25900 +30
=====================================
+ Hits 19994 20022 +28
- Misses 4849 4852 +3
+ Partials 1027 1026 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What this PR does / why we need it:
Do not skip checking certificates in gateway listeners that does not has "Programmed" condition if the
GatewayClass
is not managed by KIC. The change fixes an issue when KIC is deployed by gateway operator, certificates gets deleted when dataplane (Kong gateway) pods are changed.Which issue this PR fixes:
fixes #7660 (then also Kong/kong-operator#1769)
Special notes for your reviewer:
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR