THREESCALE-14651 Fix HPA reconciler to skip API delete calls when HPA already absent#1175
Open
urbanikb wants to merge 1 commit into3scale:masterfrom
Open
THREESCALE-14651 Fix HPA reconciler to skip API delete calls when HPA already absent#1175urbanikb wants to merge 1 commit into3scale:masterfrom
urbanikb wants to merge 1 commit into3scale:masterfrom
Conversation
ReconcileHpa() was calling DeleteResource() directly when HPA is disabled, which issues a Client().Delete() API call every reconcile cycle regardless of whether the HPA exists. After the first successful delete, subsequent cycles hit a 404 on every cycle indefinitely. Replace with TagObjectToDelete + ReconcileResource, which does a cache-backed Get first and is a no-op when the object is already gone. This is consistent with how PDB and monitoring resources are handled. Add table-driven tests covering all three HPA targets (backend-listener, backend-worker, apicast-production) across enabled, disabled, and async-disable annotation scenarios. Related: THREESCALE-14224 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1175 +/- ##
==========================================
+ Coverage 41.84% 44.03% +2.18%
==========================================
Files 203 204 +1
Lines 20859 20923 +64
==========================================
+ Hits 8729 9213 +484
+ Misses 11350 10913 -437
- Partials 780 797 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Summary
Fixes THREESCALE-14651: once an HPA was successfully deleted,
ReconcileHpa()was callingDeleteResource()directly on every subsequent reconcile cycle, hitting a 404 indefinitely.DeleteResource()withTagObjectToDelete+ReconcileResource, which does a cache-backed Get first and is a no-op when the object is already absent — consistent with how PDB and monitoring resources are handledbackend-listener,backend-worker,apicast-productionTest plan
make test-unit)spec.backend.listenerSpec.hpa,spec.backend.workerSpec.hpa,spec.apicast.productionSpec.hpa— no repeated delete attempts in operator logs after HPAs removed🤖 Generated with Claude Code