Skip to content

Conversation

randmonkey
Copy link
Contributor

@randmonkey randmonkey commented Aug 4, 2025

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:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@randmonkey randmonkey requested a review from a team as a code owner August 4, 2025 06:44
@randmonkey randmonkey force-pushed the fix/do_not_skip_gateway_listener_certs branch from 9016641 to 915a344 Compare August 4, 2025 07:51
// 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) &&
Copy link
Contributor Author

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)
Copy link
Contributor Author

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?

Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 83.72093% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.3%. Comparing base (5eea70b) to head (d2a81ea).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/controllers/gateway/gateway_controller.go 20.0% 3 Missing and 1 partial ⚠️
internal/store/store.go 66.6% 2 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not skip certificates for not programmed listeners
1 participant