-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(godaddy): Handle QUOTA_EXCEEDED error gracefully #4866
base: master
Are you sure you want to change the base?
fix(godaddy): Handle QUOTA_EXCEEDED error gracefully #4866
Conversation
The committers listed above are authorized under a signed CLA. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @alexstojda! |
Hi @alexstojda. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Hi alextojda! I saw your comment and am writing here to discuss. Thank you for actively working to solve the same problem. I also thought about reading the body message of the response to determine the exact situation of monthly quota exceeded. func (c *Client) CallAPIWithContext(ctx context.Context, method, path string, reqBody, resType interface{}, needAuth bool) error {
req, err := c.NewRequest(method, path, reqBody, needAuth)
if err != nil {
return err
}
req = req.WithContext(ctx)
response, err := c.Do(req)
if err != nil {
return err
}
return c.UnmarshalResponse(response, resType) // read body message with Reader
} As a result, it was judged that reading the body message with io.Reader in In the case of a 429 response within the |
Description
Based on some testing, it seems GoDaddy has an undocumented, per-endpoint quota.
During startup, the client calls the endpoint
https://api.godaddy.com/v1/domains?statuses=ACTIVE,PENDING_DNS_ACTIVE1
to test and validate that the credentials are working. Calling that endpoint with the same API key manually, I was able to reproduce the429
response the API sends, which did not include theRetry-After
header and thus caused the panic on startup.However, I was able to call other endpoints, ex:
https://api.godaddy.com/v1/domains/<domain>/records
, leading me to believe there is an undocumented, per-endpoint quota.With this in mind, I updated the request handler to gracefully fail without panicing when the QUOTA_EXCEEDED error occurs, so that other requests can still be attempted.
Fixes #4864
Checklist