Kong / kubernetes-ingress-controller

:gorilla: Kong for Kubernetes: The official Ingress Controller for Kubernetes.
https://docs.konghq.com/kubernetes-ingress-controller/
Apache License 2.0
2.16k stars 591 forks source link

fix: try recovering from gateway sync failure only on UpdateError #6237

Closed czeslavo closed 5 days ago

czeslavo commented 6 days ago

What this PR does / why we need it:

We should try recovering with the fallback configuration (either generated or the persisted last valid one) only if we get an expected UpdateError from the UpdateStrategy. Otherwise, we can assume the error is unrecoverable through the fallback configuration (e.g. transient network errors, gateways returning 5xx, etc.).

It relies on https://github.com/Kong/go-kong/pull/452.

Which issue this PR fixes:

Fixes https://github.com/Kong/kubernetes-ingress-controller/issues/6218.

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

codecov[bot] commented 6 days ago

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 39.1%. Comparing base (3fa3bc7) to head (15f7a40).

:exclamation: Current head 15f7a40 differs from pull request most recent head 16ce72a

Please upload reports for the commit 16ce72a to get more accurate results.

Files Patch % Lines
internal/dataplane/kong_client.go 0.0% 14 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6237 +/- ## ======================================== - Coverage 73.6% 39.1% -34.5% ======================================== Files 200 199 -1 Lines 19909 19903 -6 ======================================== - Hits 14654 7798 -6856 - Misses 4264 11168 +6904 + Partials 991 937 -54 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.