WIP: adjust return codes and add resource exhausted#96
WIP: adjust return codes and add resource exhausted#96breuerfelix wants to merge 1 commit intomainfrom
Conversation
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
237b3a4 to
be0e103
Compare
853ffd2 to
f0b9867
Compare
* use stackitProviderName everywhere Signed-off-by: Felix Breuer <f.breuer94@gmail.com> * extract secret extraction into function Signed-off-by: Felix Breuer <f.breuer94@gmail.com> --------- Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
|
|
||
| // Check for resource exhaustion errors to avoid spamming the API | ||
| errMsg := strings.ToLower(err.Error()) | ||
| if strings.Contains(errMsg, "no valid host") || strings.Contains(errMsg, "quota exceeded") { |
There was a problem hiding this comment.
Are you sure that this will be a error on the creation. If I got it correctly only the quota exceeded is a error on the create call. The no valid host is in the errorMessage in the get server https://internal-docs.api.stackit.cloud/documentation/iaas/version/v2#tag/Servers/operation/v2GetServer . Or did I get this wrong?
|
remove in favor of #99 |
How to categorize this PR?
/kind enhancement
What this PR does / why we need it:
This PR adjusts return Codes and specifically adds the return code "resource exhausted". This prevents spamming the IaaS API when there are no valid hosts anymore.
Special notes for your reviewer:
Breaking changes: