openebs / openebsctl

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

feat(pvc describe): Add mount pods #129

Closed daniel-shuy closed 3 years ago

daniel-shuy commented 3 years ago

Partially implements #59

Enhances describe pvc to display all pods that are mounting the PVC, eg.

MOUNTED BY       : pod-a pod-b 

Because the mount pod information is not added to the PersistentVolumeClaim object in k8s.io/api, I had to loop through all Pods, similar to what kubectl describe pvc is doing (see kubernetes/kubernetes#65837).

I only implemented it for describe pvc, but not describe volume, as I am not sure how to get a Pod's PV.

vharsh commented 3 years ago

@daniel-shuy You might have missed to commit the changes from pkg/persistentvolumeclaim/generic_test.go, that's why the builds seem to have failed.

daniel-shuy commented 3 years ago

@vharsh oops, you're right, I've committed it, thanks!

codecov-commenter commented 3 years ago

Codecov Report

Merging #129 (657798d) into develop (70eeb5a) will decrease coverage by 1.22%. The diff coverage is 15.38%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #129      +/-   ##
===========================================
- Coverage    69.00%   67.78%   -1.23%     
===========================================
  Files           24       24              
  Lines         1839     1878      +39     
===========================================
+ Hits          1269     1273       +4     
- Misses         561      596      +35     
  Partials         9        9              
Impacted Files Coverage Δ
pkg/persistentvolumeclaim/jiva.go 0.00% <0.00%> (ø)
pkg/persistentvolumeclaim/persistentvolumeclaim.go 0.00% <0.00%> (ø)
pkg/persistentvolumeclaim/cstor.go 100.00% <100.00%> (ø)
pkg/persistentvolumeclaim/generic.go 100.00% <100.00%> (ø)
pkg/persistentvolumeclaim/lvmlocalpv.go 100.00% <100.00%> (ø)
pkg/persistentvolumeclaim/zfslocalpv.go 100.00% <100.00%> (ø)

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 70eeb5a...657798d. Read the comment docs.