Skip to content

Conversation

@viktoryatheone
Copy link
Contributor

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Helm chart change
  • Other (please describe)

Testing

  • Unit tests added/updated
  • Helm chart tests pass (helm lint and template validation)
  • Tested changes manually
  • Added examples for new features

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have updated the relevant CRDs if needed
  • I have updated the Helm chart version if needed
  • I have added tests that prove my fix is effective or that my feature works

Additional context

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 55.71429% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.33%. Comparing base (b967da4) to head (3031fb3).
⚠️ Report is 77 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cloudprovider/ibm/errors.go 57.03% 47 Missing and 11 partials ⚠️
pkg/providers/iks/bootstrap/provider.go 0.00% 2 Missing ⚠️
pkg/providers/iks/workerpool/provider.go 33.33% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #215      +/-   ##
==========================================
- Coverage   51.33%   51.33%   -0.01%     
==========================================
  Files          56       56              
  Lines        8471     8552      +81     
==========================================
+ Hits         4349     4390      +41     
- Misses       3889     3922      +33     
- Partials      233      240       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

// IsServerError returns true if the error is a server error
func (e *IBMError) IsServerError() bool {
return e.Type == ErrorTypeServerError || (e.StatusCode >= 500 && e.StatusCode < 600)
return e.Type == ErrorTypeServerError || (e.StatusCode >= http.StatusInternalServerError && e.StatusCode < 600)
Copy link
Member

Choose a reason for hiding this comment

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

can you double check if the StatusCode returns the correct type? I think it might in fact be a string which would make these comparisons false

Comment on lines +223 to +270
// extractStatusCodeFromString safely extracts HTTP status codes from error strings
func extractStatusCodeFromString(errStr string) int {
// Prefer phrase → code mappings first so we work without digits too.
switch {
case strings.Contains(errStr, "bad gateway"):
return http.StatusBadGateway // 502
case strings.Contains(errStr, "service unavailable"):
return http.StatusServiceUnavailable // 503
case strings.Contains(errStr, "gateway timeout"):
return http.StatusGatewayTimeout // 504
case strings.Contains(errStr, "request timeout"):
return http.StatusRequestTimeout // 408
case strings.Contains(errStr, "too many requests") || strings.Contains(errStr, "rate limit"):
return http.StatusTooManyRequests // 429
case strings.Contains(errStr, "permission denied") || strings.Contains(errStr, "forbidden"):
return http.StatusForbidden // 403
case strings.Contains(errStr, "authentication failed") || strings.Contains(errStr, "unauthorized"):
return http.StatusUnauthorized // 401
case strings.Contains(errStr, "already exists") || strings.Contains(errStr, "conflict"):
return http.StatusConflict // 409
case strings.Contains(errStr, "validation") || strings.Contains(errStr, "invalid"):
return http.StatusBadRequest // 400
case strings.Contains(errStr, "not found") || strings.Contains(errStr, "not_found"):
return http.StatusNotFound // 404
}

// Then look for explicit digits.
digitToStatus := map[string]int{
"400": http.StatusBadRequest,
"401": http.StatusUnauthorized,
"403": http.StatusForbidden,
"404": http.StatusNotFound,
"408": http.StatusRequestTimeout,
"409": http.StatusConflict,
"422": http.StatusUnprocessableEntity,
"429": http.StatusTooManyRequests,
"500": http.StatusInternalServerError,
"502": http.StatusBadGateway,
"503": http.StatusServiceUnavailable,
"504": http.StatusGatewayTimeout,
}
for k, v := range digitToStatus {
if strings.Contains(errStr, k) {
return v
}
}
return 0
}
Copy link
Member

Choose a reason for hiding this comment

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

why are we doing this? isn't this part of the library?

@k8s-triage-robot
Copy link

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-contributor-experience at kubernetes/community.

/check-cla
/easycla

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 8, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 8, 2025
@pfeifferj
Copy link
Member

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 10, 2025
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 9, 2025
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. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants