Skip to content

Commit

Permalink
Merge pull request #75513 from cwdsuzhou/fix-incline-csivolume
Browse files Browse the repository at this point in the history
Kubectl: support inline csi volume
  • Loading branch information
k8s-ci-robot committed Mar 28, 2019
2 parents da7af58 + af5d651 commit 194114e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/kubectl/describe/versioned/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,8 @@ func describeVolumes(volumes []corev1.Volume, w PrefixWriter, space string) {
printFlockerVolumeSource(volume.VolumeSource.Flocker, w)
case volume.VolumeSource.Projected != nil:
printProjectedVolumeSource(volume.VolumeSource.Projected, w)
case volume.VolumeSource.CSI != nil:
printCSIVolumeSource(volume.VolumeSource.CSI, w)
default:
w.Write(LEVEL_1, "<unknown>\n")
}
Expand Down Expand Up @@ -1209,6 +1211,23 @@ func printFlockerVolumeSource(flocker *corev1.FlockerVolumeSource, w PrefixWrite
flocker.DatasetName, flocker.DatasetUUID)
}

func printCSIVolumeSource(csi *corev1.CSIVolumeSource, w PrefixWriter) {
var readOnly bool
var fsType string
if csi.ReadOnly != nil && *csi.ReadOnly {
readOnly = true
}
if csi.FSType != nil {
fsType = *csi.FSType
}
w.Write(LEVEL_2, "Type:\tCSI (a Container Storage Interface (CSI) volume source)\n"+
" Driver:\t%v\n"+
" FSType:\t%v\n"+
" ReadOnly:\t%v\n",
csi.Driver, fsType, readOnly)
printCSIPersistentVolumeAttributesMultiline(w, "VolumeAttributes", csi.VolumeAttributes)
}

func printCSIPersistentVolumeSource(csi *corev1.CSIPersistentVolumeSource, w PrefixWriter) {
w.Write(LEVEL_2, "Type:\tCSI (a Container Storage Interface (CSI) volume source)\n"+
" Driver:\t%v\n"+
Expand Down

0 comments on commit 194114e

Please sign in to comment.