From 5a537147db64d1d563a4f8963a7a2bb4aa914815 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Wed, 7 Apr 2021 08:58:18 -0400 Subject: [PATCH] CSI: fix index error on formatting function for volume snapshots --- command/volume_snapshot_list.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command/volume_snapshot_list.go b/command/volume_snapshot_list.go index aabba87d6..cc2b8d68d 100644 --- a/command/volume_snapshot_list.go +++ b/command/volume_snapshot_list.go @@ -147,14 +147,14 @@ func csiFormatSnapshots(snapshots []*api.CSISnapshot, verbose bool) string { if verbose { length = 30 } - for i, v := range snapshots { - rows[i+1] = fmt.Sprintf("%s|%s|%s|%s|%v", + for _, v := range snapshots { + rows = append(rows, fmt.Sprintf("%s|%s|%s|%s|%v", limit(v.ID, length), limit(v.ExternalSourceVolumeID, length), humanize.IBytes(uint64(v.SizeBytes)), formatUnixNanoTime(v.CreateTime), v.IsReady, - ) + )) } return formatList(rows) }