Skip to content
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

🐛 k8s: don't fail during api resource discovery #5245

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

afiune
Copy link
Contributor

@afiune afiune commented Feb 19, 2025

Closes #5165

A sand-boxed cluster doesn't have metrics server enabled:
https://cloud.google.com/kubernetes-engine/docs/concepts/sandbox-pods#limitations-incompatible

This code fails just because that single API resource, out of 40+ resources, fails.

Screenshot 2025-02-18 at 6 30 06 PM

Now we will just display a warning that "some" api resources aren't available.

Copy link
Contributor

Test Results

3 350 tests  ±0   3 346 ✅ ±0   1m 46s ⏱️ +8s
  391 suites ±0       4 💤 ±0 
   30 files   ±0       0 ❌ ±0 

Results for commit f042b52. ± Comparison against base commit 53a692f.

@@ -73,7 +73,7 @@ func (d *Discovery) SupportedResourceTypes() (*ApiResourceIndex, error) {
log.Debug().Msg("query api resource types")
resList, err := d.discoveryClient.ServerPreferredResources()
if err != nil {
return nil, errors.Wrap(err, "failed to fetch api resource types from kubernetes")
log.Warn().Err(err).Msg("failed to fetch api resource types from kubernetes")
Copy link
Member

Choose a reason for hiding this comment

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

It does not feel right to not throw the error here.

@afiune afiune marked this pull request as draft February 19, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants