Skip to content

feat: retry IBM Cloud Global Catalog calls on HTTP 429#516

Open
nekkunti wants to merge 1 commit intokubernetes-sigs:mainfrom
nekkunti:add_retry_for_api_rate_limit
Open

feat: retry IBM Cloud Global Catalog calls on HTTP 429#516
nekkunti wants to merge 1 commit intokubernetes-sigs:mainfrom
nekkunti:add_retry_for_api_rate_limit

Conversation

@nekkunti
Copy link
Contributor

@nekkunti nekkunti commented Feb 13, 2026

Description

Add a shared DoWithRetry helper to handle IBM Cloud API rate limiting (HTTP 429) using exponential backoff and honoring the Retry-After header when present.

Apply the retry wrapper to GlobalCatalog client call sites:

  • GetCatalogEntryWithContext
  • ListCatalogEntriesWithContext
  • GetPricing

It fixes issue#502

Type of change

  • New feature (adds HTTP 429 retry handling for IBM Cloud APIs)

Testing

  • successful call without retry
  • non-429 passthrough
  • retry then success
  • retry exhaustion
  • context cancellation
  • Retry-After handling without real sleep

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 13, 2026
@nekkunti
Copy link
Contributor Author

@meomnzak @pfeifferj can you look into this PR

@nekkunti
Copy link
Contributor Author

nekkunti commented Feb 13, 2026

/ok-to-test

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.00%. Comparing base (18e7a4b) to head (203581d).

Files with missing lines Patch % Lines
pkg/cloudprovider/ibm/catalog.go 66.66% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
+ Coverage   56.92%   57.00%   +0.07%     
==========================================
  Files          61       62       +1     
  Lines        8992     9017      +25     
==========================================
+ Hits         5119     5140      +21     
- Misses       3508     3511       +3     
- Partials      365      366       +1     
Files with missing lines Coverage Δ
pkg/cloudprovider/ibm/retry.go 100.00% <100.00%> (ø)
pkg/cloudprovider/ibm/catalog.go 73.91% <66.66%> (-0.70%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nekkunti nekkunti force-pushed the add_retry_for_api_rate_limit branch from 203581d to d0fad40 Compare February 13, 2026 16:17
@nekkunti
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@nekkunti: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

@nekkunti
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@nekkunti: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

@nekkunti
Copy link
Contributor Author

@meomnzak. Could you check now

@nekkunti
Copy link
Contributor Author

nekkunti commented Feb 13, 2026

/ok-to-test

Add a shared DoWithRetry helper to handle IBM Cloud API rate
limiting (HTTP 429) using exponential backoff and honoring the
Retry-After header when present.

Apply the retry wrapper to GlobalCatalog client call sites:
- GetCatalogEntryWithContext
- ListCatalogEntriesWithContext
- GetPricing

Add unit tests covering:
- successful call without retry
- non-429 passthrough
- retry then success
- retry exhaustion
- context cancellation
- Retry-After handling without real sleep
- Retry InvalidRetryAfterFallsBack

Signed-off-by: Anand Nekkunti <anand.nekkunti@ibm.com>
@nekkunti nekkunti force-pushed the add_retry_for_api_rate_limit branch from d0fad40 to 77795d6 Compare February 16, 2026 13:14
@nekkunti
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@nekkunti: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

@nekkunti
Copy link
Contributor Author

@meomnzak Could you check now, All comments are resolved

Copy link
Contributor

@meomnzak meomnzak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great work 🙌

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: meomnzak, nekkunti
Once this PR has been reviewed and has the lgtm label, please assign pfeifferj for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

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

@nekkunti
Copy link
Contributor Author

nekkunti commented Feb 16, 2026

LGTM, great work 🙌

Thank you.

@nekkunti
Copy link
Contributor Author

nekkunti commented Feb 16, 2026

@meomnzak Could you trigger tests

@meomnzak @pfeifferj Please approve this PR .

@nekkunti
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@nekkunti: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

@pfeifferj
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 16, 2026
@nekkunti
Copy link
Contributor Author

nekkunti commented Feb 16, 2026

@pfeifferj @meomnzak
it seems , in CI , it is using latest CONTROLLER GEN version to generate crd files , so it is failing . it is not related my PR.
I have identified when build locally , created issue
this PR will fix this issues.


-    controller-gen.kubebuilder.io/version: v0.20.0
+    controller-gen.kubebuilder.io/version: v0.20.1
   name: nodepools.karpenter.sh
 spec:
   group: karpenter.sh
Error: Generated code (CRDs/deepcopy) is out of date. Run 'make generate' and commit the changes.
Error: Process completed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Add retry for IBM Cloud API rate limiting (HTTP 429)

5 participants