Skip to content

Commit

Permalink
csi support for kubectl os csi
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Apr 21, 2019
1 parent 28efa0c commit 20a5e6d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ func GetPersistentVolumes(kubeClient *kubernetes.Clientset) (map[string]v1.Persi
}
pvMap := map[string]v1.PersistentVolume{}
for _, pv := range pvs.Items {
if pv.Spec.Cinder == nil {
if pv.Spec.Cinder != nil {
// TODO log(skipping pv because it is no cinder volume)
pvMap[pv.Spec.Cinder.VolumeID] = pv
continue
}
if pv.Spec.CSI != nil {
// TODO log(skipping pv because it is no cinder volume)
pvMap[pv.Spec.CSI.VolumeHandle] = pv
continue
}
pvMap[pv.Spec.Cinder.VolumeID] = pv
}
return pvMap, nil
}
Expand Down

0 comments on commit 20a5e6d

Please sign in to comment.