Add client-go-compatible Retry-After retries to generated clients - #2671
Add client-go-compatible Retry-After retries to generated clients#2671sttts wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sttts The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@sttts thanks for the PR, please take a look at the CI test failures |
|
@yliaog it's green now |
|
please remove fixup! in the commit message also investigate e2e test failure |
| T = TypeVar("T") | ||
|
|
||
|
|
||
| async def on_retry_after_error( |
There was a problem hiding this comment.
why not use kubernetes/aio/utils/retry.py ?
| T = TypeVar("T") | ||
|
|
||
|
|
||
| def on_retry_after_error( |
There was a problem hiding this comment.
why not use kubernetes/utils/retry.py ?
|
close to retrigger the CI tests |
|
@yliaog: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/reopen |
|
@yliaog: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/retest |
|
@sttts: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/close |
|
@yliaog: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/reopen |
|
@yliaog: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/close |
|
@yliaog: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/reopen |
|
@yliaog: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/close |
|
@yliaog: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/reopen |
|
@yliaog: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
dbccac0 to
7efe5a4
Compare
|
@yliaog have squashed to remove the fixup commit. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Wires the retry helpers from #2634 into the generated sync and asyncio REST clients via repo-local post-generation patches, matching the Java-style approach instead of carrying Kubernetes-specific behavior in kubernetes-client/gen.
The generated clients gain opt-in
client_go_retriessupport forGETandHEADRetry-After responses. The retry ceiling followsconfiguration.retrieswhen set and otherwise uses the client-go default. Sync uses urllib3 for normal retries and disables urllib3 status retries only for the client-go read wrapper; asyncio uses its async helper directly for that same read path.Which issue(s) this PR fixes:
None
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Testing
git diff --checkgit apply --unidiff-zero --reverse --check scripts/client_go_retry_patch.diffgit apply --unidiff-zero --reverse --check scripts/client_go_retry_asyncio_patch.diffgit apply --unidiff-zero --check scripts/client_go_retry_patch.diffagainst a freshorigin/masterworktreegit apply --unidiff-zero --check scripts/client_go_retry_asyncio_patch.diffagainst a freshorigin/masterworktreepython3 -m py_compile ...for the changed retry/rest/config/test modulesuv run --with-requirements requirements.txt --with-requirements requirements-asyncio.txt python -c "import kubernetes.client.rest; import kubernetes.aio.client.rest"uv run --with-requirements requirements.txt --with-requirements requirements-asyncio.txt python -m unittest -q ...for the new targeted retry tests