Repository navigation
ICNAS-928: Reduce Cloud API requests on stuck deletes - #421
Open
mcaratas-ionos wants to merge 14 commits into
Open
mcaratas-ionos wants to merge 14 commits into
mcaratas-ionos wants to merge 14 commits into
Conversation
mcaratas-ionos
force-pushed
the
fix/ICNAS-928
branch
from
November 18, 2026 08:02
50f2d96 to
011c7ee
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Process-wide throttle keys omit the request origin, allowing throttling on one API endpoint to incorrectly suppress requests to another healthy endpoint.
1 open issue
What changed in this PR
This PR reduces Cloud API traffic during stuck or long-running deletions in the IONOS Cloud provider.
Changes:
- Persists DELETE request IDs, adds configurable wait limits, and delays LAN deletion while NICs remain attached.
- Adds polling backoff, disables rapid SDK retries, and introduces optional write throttling.
- Adds tests and documentation, updates Go dependencies, and adjusts CI image lookup.
| File | Description |
|---|---|
internal/controller/compute/volume/volume.go |
Tracks pending volume deletes and applies wait limits. |
internal/controller/compute/server/server.go |
Tracks pending server deletes and applies wait limits. |
internal/controller/compute/nic/nic.go |
Tracks pending NIC deletes and applies wait limits. |
internal/controller/compute/lan/lan.go |
Checks attached NICs and tracks pending LAN deletes. |
internal/controller/compute/lan/lan_mock_test.go |
Tests attached-NIC and pending-delete behavior. |
internal/controller/compute/firewallrule/firewallrule.go |
Tracks pending firewall-rule deletes and applies wait limits. |
internal/clients/throttle_transport.go |
Adds shared throttling after 429 and DELETE 422 responses. |
internal/clients/throttle_transport_test.go |
Tests throttle behavior and transport integration. |
internal/clients/ionoscloud.go |
Configures single-attempt requests and optional throttling. |
internal/clients/ionoscloud_test.go |
Updates expected SDK retry settings. |
internal/clients/compute/compute.go |
Adds polling backoff, delete tracking, and bounded waits. |
internal/clients/compute/compute_test.go |
Tests polling, persistence, and wait limits. |
go.sum |
Updates dependency checksums. |
go.mod |
Updates Go and dependency versions. |
docs/README.md |
Documents polling, throttling, and delete-wait flags. |
docs/CHANGELOG.md |
Records behavior and tooling changes. |
cmd/provider/main.go |
Registers and validates the new flags. |
.github/workflows/ci.yml |
Updates lint tooling and image ID lookup. |
.github/workflows/ci-weekly.yml |
Updates image ID lookup for vulnerability scanning. |
.github/workflows/cd.yml |
Updates image ID lookup for vulnerability scanning. |
Review effort: Balanced
Comment on lines
+130
to
+131
| datacenterID := datacenterIDFromPath(req.URL.Path) | ||
| requestKey := req.Method + " " + req.URL.Path |
mcaratas-ionos
marked this pull request as ready for review
November 25, 2026 09:10
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.

Description of your changes
This PR adds backoff and wait mechanisms that reduce the number of Cloud API requests when a delete request takes long or gets stuck, which also avoids repeated 422/429 responses.
This PR adds:
MaxRetries = 1). Transient status errors (429, 5xx, short network errors) keep the poll going instead of failing it.ionos.cloud/delete-request-idannotation (Server, Nic, Volume, FirewallRule, Lan). Later reconciles check that request instead of sending a new DELETE.--delete-request-wait: how long a Delete waits for its request before ending the reconcile.--api-throttle-wait/--api-throttle-max-wait: after a 429, writes to that datacenter are held (Retry-After is honoured); after a 422, that DELETE is held. Held requests get a local 429 with errorCodePROVIDER_THROTTLED.golang.org/x/netv0.62.0, golangci-lint v2.15.0, and a Trivy image ID fix for Docker 29 runners (CI is red without these).Checklist
I have:
feat/fix/doc/test/refactor)make reviewableandmake crds.cleanto ensure the PR is ready for reviewmake docs.update(if applicable)docs/CHANGELOG.mdfile (label:upcoming release)