mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Kubectl: support inline csi volume
This commit is contained in:
parent
155688b2f3
commit
af5d6518ff
@ -809,6 +809,8 @@ func describeVolumes(volumes []corev1.Volume, w PrefixWriter, space string) {
|
|||||||
printFlockerVolumeSource(volume.VolumeSource.Flocker, w)
|
printFlockerVolumeSource(volume.VolumeSource.Flocker, w)
|
||||||
case volume.VolumeSource.Projected != nil:
|
case volume.VolumeSource.Projected != nil:
|
||||||
printProjectedVolumeSource(volume.VolumeSource.Projected, w)
|
printProjectedVolumeSource(volume.VolumeSource.Projected, w)
|
||||||
|
case volume.VolumeSource.CSI != nil:
|
||||||
|
printCSIVolumeSource(volume.VolumeSource.CSI, w)
|
||||||
default:
|
default:
|
||||||
w.Write(LEVEL_1, "<unknown>\n")
|
w.Write(LEVEL_1, "<unknown>\n")
|
||||||
}
|
}
|
||||||
@ -1208,6 +1210,23 @@ func printFlockerVolumeSource(flocker *corev1.FlockerVolumeSource, w PrefixWrite
|
|||||||
flocker.DatasetName, flocker.DatasetUUID)
|
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) {
|
func printCSIPersistentVolumeSource(csi *corev1.CSIPersistentVolumeSource, w PrefixWriter) {
|
||||||
w.Write(LEVEL_2, "Type:\tCSI (a Container Storage Interface (CSI) volume source)\n"+
|
w.Write(LEVEL_2, "Type:\tCSI (a Container Storage Interface (CSI) volume source)\n"+
|
||||||
" Driver:\t%v\n"+
|
" Driver:\t%v\n"+
|
||||||
|
Loading…
Reference in New Issue
Block a user