openebs / openebsctl

`openebsctl` is a kubectl plugin to manage OpenEBS storage components.
Apache License 2.0
30 stars 21 forks source link

refractor: Wrap NewK8sClient for error handling in client init #120

Closed Abhishek-kumar09 closed 3 years ago

Abhishek-kumar09 commented 3 years ago

Signed-off-by: Abhishek-kumar09 abhimait1909@gmail.com In the case of wrong kubeconfig, or no kubeconfig or no kubernetes the client initialisation throws error which are not handled by the current code at multiple places resulting in panic by CLI.

codecov-commenter commented 3 years ago

Codecov Report

Merging #120 (e39f511) into develop (b6c29c2) will increase coverage by 2.63%. The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #120      +/-   ##
===========================================
+ Coverage    67.08%   69.72%   +2.63%     
===========================================
  Files           24       24              
  Lines         1820     1820              
===========================================
+ Hits          1221     1269      +48     
+ Misses         590      542      -48     
  Partials         9        9              
Impacted Files Coverage Δ
pkg/blockdevice/blockdevice.go 73.07% <0.00%> (ø)
pkg/cluster-info/cluster-info.go 95.37% <0.00%> (ø)
pkg/persistentvolumeclaim/debug.go 0.00% <0.00%> (ø)
pkg/persistentvolumeclaim/persistentvolumeclaim.go 0.00% <0.00%> (ø)
pkg/storage/storage.go 0.00% <0.00%> (ø)
pkg/volume/volume.go 13.04% <0.00%> (ø)
pkg/util/util.go 51.04% <0.00%> (ø)
pkg/volume/local_hostpath.go 100.00% <0.00%> (+100.00%) :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 b6c29c2...e39f511. Read the comment docs.