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

fix(discovery): Do not fail if missing a subset of resources during API discover #406

Merged

Conversation

mikesmithgh
Copy link
Collaborator

The purpose of this PR is to avoid completely failing API discovery if only a subset of resources fail to be fetched.

In my particular case, another team managing keda-operator-metrics-apiserver occasionally goes into a bad state causing an error discovery resources. If metacontroller is starting up for the first time, then it will get an error fetching resources and be blocked until the keda operator is in a good state and responds with resources during API discovery.

{"level":"error","ts":1638640761.0517867,"msg":"Failed to fetch discovery info","error":"unable to retrieve the complete list of server APIs: external.metrics.k8s.io/v1beta1: the server is currently unable to handle the request","stacktrace":"metacontroller/pkg/dynamic/discovery.(*ResourceMap).Start.func1\n\t/go/src/metacontroller/pkg/dynamic/discovery/discovery.go:179"}

…PI discover

Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Dec 6, 2021

Codecov Report

Merging #406 (a517d7b) into master (c93fb62) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #406      +/-   ##
==========================================
- Coverage   49.55%   49.52%   -0.04%     
==========================================
  Files          54       54              
  Lines        3295     3297       +2     
==========================================
  Hits         1633     1633              
- Misses       1420     1422       +2     
  Partials      242      242              
Flag Coverage Δ
integration 41.87% <0.00%> (-0.03%) ⬇️
unit 29.20% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/dynamic/discovery/discovery.go 76.92% <0.00%> (-2.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c93fb62...a517d7b. Read the comment docs.

@AmitKumarDas AmitKumarDas requested a review from grzesuav December 6, 2021 13:33
AmitKumarDas
AmitKumarDas previously approved these changes Dec 6, 2021
Copy link
Contributor

@AmitKumarDas AmitKumarDas left a comment

Choose a reason for hiding this comment

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

/LGTM
Provided some suggestions

@mikesmithgh mikesmithgh force-pushed the ignore-missing-k8s-resources branch 2 times, most recently from d025590 to aadc1bb Compare December 6, 2021 18:22
Signed-off-by: Mike Smith <10135646+mjsmith1028@users.noreply.github.com>
@mikesmithgh
Copy link
Collaborator Author

Hi @grzesuav , would you be able to rerun the failing actions on this PR? I am able to run them successfully locally so I am not sure if there is just some flakiness going on or if my change would have any impact on the failiures.

@grzesuav grzesuav merged commit c40ab60 into metacontroller:master Dec 7, 2021
@grzesuav
Copy link
Contributor

grzesuav commented Dec 7, 2021

🎉 This PR is included in version 2.0.18 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants