timfeirg / lain-cli

DevOps with minimum effort.
https://lain-cli.readthedocs.io/en/latest/
MIT License
31 stars 9 forks source link

[lain use] check kubectl version #33

Closed timfeirg closed 2 years ago

timfeirg commented 2 years ago

曾经, lain use 之后是会自动检查 kubectl 版本是否匹配的, 但这个功能当时属于"顺手随便做", 带来一些预期外的小问题, 因此随着迭代删掉了.

这次将这个特性加回来, 并且加强了版本检查的鲁棒性, 跑完 asdf 以后如果还是探测到版本不匹配, 则直接报错退出, 并提示用户进行修复:

image
codecov-commenter commented 2 years ago

Codecov Report

Merging #33 (11af657) into master (a2d361b) will decrease coverage by 0.04%. The diff coverage is 22.22%.

@@            Coverage Diff             @@
##           master      #33      +/-   ##
==========================================
- Coverage   56.02%   55.97%   -0.05%     
==========================================
  Files          14       14              
  Lines        3884     3898      +14     
==========================================
+ Hits         2176     2182       +6     
- Misses       1708     1716       +8     
Impacted Files Coverage Δ
lain_cli/utils.py 70.97% <12.50%> (-0.45%) :arrow_down:
lain_cli/__init__.py 100.00% <100.00%> (ø)
lain_cli/lain.py 52.48% <100.00%> (+0.36%) :arrow_up:

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 a2d361b...11af657. Read the comment docs.