Repository navigation
fix: avoid metric increments on no-op delete reconcile paths - #8480
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Felipe Sabadini Facina <[email protected]>
34ab03c to
3d91d12
Compare
|
Validated in a local Kind test cluster (default Deployment mode, no HPA/PDB/DaemonSet configured).
Observed:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8480 +/- ##
==========================================
- Coverage 74.38% 74.34% -0.05%
==========================================
Files 243 243
Lines 38227 38262 +35
==========================================
+ Hits 28436 28444 +8
- Misses 7802 7823 +21
- Partials 1989 1995 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @felipesabadini, thanks for working this! |
jukie
left a comment
There was a problem hiding this comment.
This will fix linting issues:
Signed-off-by: Isaac Wilson <[email protected]>
|
/retest |
|
hey @felipesabadini can you help with these follow ups
#8438 looks fixed for the no-op delete case, but failure-path observability |
…oxy#8480) * fix: avoid metric increments on no-op delete reconcile paths Signed-off-by: Felipe Sabadini Facina <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> --------- Signed-off-by: Felipe Sabadini Facina <[email protected]> Signed-off-by: Isaac Wilson <[email protected]> Co-authored-by: Isaac Wilson <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]>
* fix: avoid metric increments on no-op delete reconcile paths (#8480) * fix: avoid metric increments on no-op delete reconcile paths Signed-off-by: Felipe Sabadini Facina <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> --------- Signed-off-by: Felipe Sabadini Facina <[email protected]> Signed-off-by: Isaac Wilson <[email protected]> Co-authored-by: Isaac Wilson <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: restore failure-path metric recording for delete and HPA reconcile (#8656) Fixes #8651 Signed-off-by: Felipe Sabadini Facina <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: helm secrets rbac for gateway namespace with watch list of namespaces (#8706) * fix: helm secrets rbac for gateway namespace with watch list of namespaces Signed-off-by: Karol Szwaj <[email protected]> * add release notes Signed-off-by: Karol Szwaj <[email protected]> * review update Signed-off-by: Karol Szwaj <[email protected]> --------- Signed-off-by: Karol Szwaj <[email protected]> Co-authored-by: Rudrakh Panigrahi <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: handle network errors in rate limit e2e tests (#8446) Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: propagate the HTTPFilter translation errors to the outer layer (#7556) * progate the HTTPFilter validation errors to the outer layer Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: return 500 error for invalid filters (#7605) return 500 error for invalid filters Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: prevent configuring requestMirror filter and directResponse/RequestRedirect filter together (#7474) * fix: prevent configuring RequestMirror and DirectResponse filters together Signed-off-by: Huabing Zhao <[email protected]> check redirect respose filter Signed-off-by: Huabing Zhao <[email protected]> * address comments Signed-off-by: Huabing Zhao <[email protected]> * fix lint Signed-off-by: Huabing Zhao <[email protected]> --------- Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix bug with grpcroute mirror filter (#8541) * fix bug with grpcroute mirror filter Signed-off-by: Adam Buran <[email protected]> * add indexers test Signed-off-by: Adam Buran <[email protected]> * add release note Signed-off-by: Adam Buran <[email protected]> --------- Signed-off-by: Adam Buran <[email protected]> Signed-off-by: Arko Dasgupta <[email protected]> Co-authored-by: Arko Dasgupta <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: normalize CRLF line endings in htpasswd basic auth secrets (#8557) Fixes #8554 Signed-off-by: stekole <[email protected]> Signed-off-by: stekole <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: status for mirror backend (#8675) Signed-off-by: kkk777-7 <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: set HTTPRoute Accepted condition as true with mixed invalid and valid rules (#7625) * set HTTPRoute Accepted condition as true with mixed invalid and valid rules Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * fix: basic auth validation (#8053) * fix basic auth validation Signed-off-by: Huabing (Robin) Zhao <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> * [release/v1.6] fix gen check Signed-off-by: Rudrakh Panigrahi <[email protected]> --------- Signed-off-by: Felipe Sabadini Facina <[email protected]> Signed-off-by: Isaac Wilson <[email protected]> Signed-off-by: Rudrakh Panigrahi <[email protected]> Signed-off-by: Karol Szwaj <[email protected]> Signed-off-by: Huabing Zhao <[email protected]> Signed-off-by: Adam Buran <[email protected]> Signed-off-by: Arko Dasgupta <[email protected]> Signed-off-by: stekole <[email protected]> Signed-off-by: stekole <[email protected]> Signed-off-by: kkk777-7 <[email protected]> Signed-off-by: Huabing (Robin) Zhao <[email protected]> Co-authored-by: Felipe Sabadini <[email protected]> Co-authored-by: Isaac Wilson <[email protected]> Co-authored-by: Karol Szwaj <[email protected]> Co-authored-by: Huabing (Robin) Zhao <[email protected]> Co-authored-by: aburanrbx <[email protected]> Co-authored-by: Arko Dasgupta <[email protected]> Co-authored-by: stekole <[email protected]> Co-authored-by: Kota Kimura <[email protected]>
…oxy#8480) * fix: avoid metric increments on no-op delete reconcile paths Signed-off-by: Felipe Sabadini Facina <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> --------- Signed-off-by: Felipe Sabadini Facina <[email protected]> Signed-off-by: Isaac Wilson <[email protected]> Co-authored-by: Isaac Wilson <[email protected]> (cherry picked from commit 7a2a4ec) Signed-off-by: Karol Szwaj <[email protected]>
* fix: handle network errors in rate limit e2e tests (#8446) Signed-off-by: Rudrakh Panigrahi <[email protected]> (cherry picked from commit b0638d5) Signed-off-by: Karol Szwaj <[email protected]> * refactor/perf: use LuaPerRoute instead of FilterConfig (#8355) perf: use LuaPerRoute instead of FilterConfig Signed-off-by: Rudrakh Panigrahi <[email protected]> (cherry picked from commit f31ac4e) Signed-off-by: Karol Szwaj <[email protected]> * fix: per-endpoint hostname override blocked by auto-generated wildcad host (#8565) * fix: per-endpoint hostname override blocked by auto-generated wildcard host Signed-off-by: zirain <[email protected]> * add UT Signed-off-by: zirain <[email protected]> --------- Signed-off-by: zirain <[email protected]> (cherry picked from commit 595010a) Signed-off-by: Karol Szwaj <[email protected]> * fix bug with grpcroute mirror filter (#8541) * fix bug with grpcroute mirror filter Signed-off-by: Adam Buran <[email protected]> * add indexers test Signed-off-by: Adam Buran <[email protected]> * add release note Signed-off-by: Adam Buran <[email protected]> --------- Signed-off-by: Adam Buran <[email protected]> Signed-off-by: Arko Dasgupta <[email protected]> Co-authored-by: Arko Dasgupta <[email protected]> (cherry picked from commit e633c08) Signed-off-by: Karol Szwaj <[email protected]> * fix: normalize CRLF line endings in htpasswd basic auth secrets (#8557) Fixes #8554 Signed-off-by: stekole <[email protected]> Signed-off-by: stekole <[email protected]> (cherry picked from commit 9cac348) Signed-off-by: Karol Szwaj <[email protected]> * fix: avoid metric increments on no-op delete reconcile paths (#8480) * fix: avoid metric increments on no-op delete reconcile paths Signed-off-by: Felipe Sabadini Facina <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> * Update internal/infrastructure/kubernetes/infra_resource_test.go Signed-off-by: Isaac Wilson <[email protected]> --------- Signed-off-by: Felipe Sabadini Facina <[email protected]> Signed-off-by: Isaac Wilson <[email protected]> Co-authored-by: Isaac Wilson <[email protected]> (cherry picked from commit 7a2a4ec) Signed-off-by: Karol Szwaj <[email protected]> * fix(telemetry): support BackendTLSPolicy for telemetry backends (#8545) * fix(telemetry): support BackendTLSPolicy for telemetry backends processBackendRefs does not look up BackendTLSPolicy for telemetry backends (access logs, tracing, metrics), so TLS can only be configured via Backend.spec.tls. Replace inline processServerValidationTLSSettings with applyBackendTLSSetting so telemetry backends get the full Backend + BackendTLSPolicy + EnvoyProxy TLS merge. Workaround: theagentrouter/agent-router#1964 Signed-off-by: Adrian Cole <[email protected]> (cherry picked from commit ac18feb) Signed-off-by: Karol Szwaj <[email protected]> * fix: restore failure-path metric recording for delete and HPA reconcile (#8656) Fixes #8651 Signed-off-by: Felipe Sabadini Facina <[email protected]> (cherry picked from commit 2a5bfd0) Signed-off-by: Karol Szwaj <[email protected]> * fix: status for mirror backend (#8675) Signed-off-by: kkk777-7 <[email protected]> (cherry picked from commit fa81778) Signed-off-by: Karol Szwaj <[email protected]> * fix: client certificate secret never delivered when it is exclusively referenced by a SecurityPolicy extAuth Backend (#8654) * fix: client certificate secret never delivered when it is exclusively referenced by a SecurityPolicy extAuth Backend Signed-off-by: zirain <[email protected]> * fix lint Signed-off-by: zirain <[email protected]> --------- Signed-off-by: zirain <[email protected]> (cherry picked from commit c7e21fa) Signed-off-by: Karol Szwaj <[email protected]> * fix: client certificate secret never delivered when it is exclusively referenced by a SecurityPolicy jwt/oidc Backend (#8711) Signed-off-by: zirain <[email protected]> (cherry picked from commit 95c3a79) Signed-off-by: Karol Szwaj <[email protected]> * fix: helm secrets rbac for gateway namespace with watch list of namespaces (#8706) * fix: helm secrets rbac for gateway namespace with watch list of namespaces Signed-off-by: Karol Szwaj <[email protected]> * add release notes Signed-off-by: Karol Szwaj <[email protected]> * review update Signed-off-by: Karol Szwaj <[email protected]> --------- Signed-off-by: Karol Szwaj <[email protected]> Co-authored-by: Rudrakh Panigrahi <[email protected]> (cherry picked from commit c48a346) Signed-off-by: Karol Szwaj <[email protected]> * add release notes Signed-off-by: Karol Szwaj <[email protected]> * fix lint Signed-off-by: Karol Szwaj <[email protected]> * fix lint Signed-off-by: Karol Szwaj <[email protected]> --------- Signed-off-by: Rudrakh Panigrahi <[email protected]> Signed-off-by: Karol Szwaj <[email protected]> Signed-off-by: zirain <[email protected]> Signed-off-by: Adam Buran <[email protected]> Signed-off-by: Arko Dasgupta <[email protected]> Signed-off-by: stekole <[email protected]> Signed-off-by: stekole <[email protected]> Signed-off-by: Felipe Sabadini Facina <[email protected]> Signed-off-by: Isaac Wilson <[email protected]> Signed-off-by: Adrian Cole <[email protected]> Signed-off-by: kkk777-7 <[email protected]> Co-authored-by: Rudrakh Panigrahi <[email protected]> Co-authored-by: zirain <[email protected]> Co-authored-by: aburanrbx <[email protected]> Co-authored-by: Arko Dasgupta <[email protected]> Co-authored-by: stekole <[email protected]> Co-authored-by: Felipe Sabadini <[email protected]> Co-authored-by: Isaac Wilson <[email protected]> Co-authored-by: Adrian Cole <[email protected]> Co-authored-by: Kota Kimura <[email protected]>
What type of PR is this?
fix: avoid metric increments on no-op delete reconcile pathsWhat this PR does / why we need it
This PR fixes metric inflation during no-op reconciles for optional resources.
Previously,
deleteDeployment,deleteDaemonSet,deleteHPA, anddeletePDBalways calledDeleteAllOfand recordedresource_delete_*success metrics, even when no matching resources existed. In default Deployment mode (without DaemonSet/HPA/PDB), this caused delete metrics to grow continuously despite no real deletions.Additionally,
createOrUpdateHPAandcreateOrUpdatePodDisruptionBudgetregistered apply metric defers before nil checks, causingresource_apply_totalto be incremented on the nil->delete path.Changes
Listwith the same namespace/label selector) in:deleteDeploymentdeleteDaemonSetdeleteHPAdeletePDBdeferblocks in:createOrUpdateHPAcreateOrUpdatePodDisruptionBudgetto run only in actual apply paths (after nil checks), matching Deployment/DaemonSet behavior.
Which issue(s) this PR fixes
Fixes #8438
Release Notes
No