Skip to content

Use go-retry for HTTP retry#126

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
saschagrunert:retry-api
Jan 31, 2025
Merged

Use go-retry for HTTP retry#126
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
saschagrunert:retry-api

Conversation

@saschagrunert
Copy link
Copy Markdown
Member

@saschagrunert saschagrunert commented Jan 31, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

Refine the way how we retry HTTP requests, by allowing users to actually set the wait time using WithWaitTime and WithMaxWaitTime. Simplify the code by using the go-retry dependency and filter based on HTTP return codes as well as generic errors.

Adding unit tests for the new cases.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

http: Added `WithWaitTime` and `WithMaxWaitTime` to allow specifying the HTTP retry wait times.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. sig/release Categorizes an issue or PR as relevant to SIG Release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 31, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 31, 2025
Refine the way how we retry HTTP requests, by allowing users to actually
set the wait time using `WithWaitTime` and `WithMaxWaitTime`. Simplify
the code by using the go-retry dependency and filter based on HTTP
return codes as well as generic errors.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [cpanato,saschagrunert]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 196ffaa into kubernetes-sigs:main Jan 31, 2025
@saschagrunert saschagrunert deleted the retry-api branch January 31, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants