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

Warn if kubectl can't autodetect the version #656

Merged
merged 3 commits into from
Aug 4, 2020
Merged

Conversation

lizrice
Copy link
Contributor

@lizrice lizrice commented Aug 3, 2020

See #655. This outputs a warning if kubectl doesn't have access to kubeconfig and can't autodetect the version.

Modified code to only run getBenchmarkVersion() once per command, so that this new warning doesn't get emitted four times! (Note that the loadConfig() function can get called several times from the code in root.go)

This PR doesn't update the default version yet so it's not a full fix for the issue.

@lizrice lizrice requested a review from yoavrotems August 3, 2020 19:15
@lizrice lizrice self-assigned this Aug 3, 2020
@codecov
Copy link

codecov bot commented Aug 3, 2020

Codecov Report

Merging #656 into master will decrease coverage by 1.60%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #656      +/-   ##
==========================================
- Coverage   66.51%   64.91%   -1.61%     
==========================================
  Files          12       12              
  Lines        1117     1120       +3     
==========================================
- Hits          743      727      -16     
- Misses        336      357      +21     
+ Partials       38       36       -2     
Impacted Files Coverage Δ
cmd/common.go 40.74% <0.00%> (-5.82%) ⬇️
cmd/master.go 53.33% <0.00%> (-8.21%) ⬇️
cmd/node.go 53.33% <0.00%> (-8.21%) ⬇️
cmd/root.go 49.36% <0.00%> (ø)
cmd/util.go 71.63% <0.00%> (-1.05%) ⬇️

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 5ff32e5...faf07d2. Read the comment docs.

cmd/util.go Outdated Show resolved Hide resolved
Copy link
Contributor

@yoavrotems yoavrotems left a comment

Choose a reason for hiding this comment

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

LGTM :)

@yoavrotems yoavrotems merged commit a6161aa into master Aug 4, 2020
@lizrice lizrice deleted the auto-detect branch December 17, 2020 13:47
caruccio pushed a commit to getupcloud/kube-bench that referenced this pull request Feb 19, 2021
* Add warning if lacking kubeconfig for auto-detect

* Only run getbenchmarkVersion once

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

Successfully merging this pull request may close these issues.

None yet

2 participants