Skip to content

Commit 049dc23

Browse files
authored
Show Drive ID in 'list drives' default output (#1009)
In many support/debugging cases, the drive ID is asked every time. Previously it is shown only in `-o wide` output. This patch fixes to make it as default. Signed-off-by: Bala.FA <bala@minio.io>
1 parent 4264a80 commit 049dc23

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

cmd/kubectl-directpv/list_drives.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ func listDrivesMain(ctx context.Context) {
140140
}
141141

142142
headers := table.Row{
143+
"DRIVE ID",
143144
"NODE",
144145
"NAME",
145146
"MAKE",
@@ -148,9 +149,6 @@ func listDrivesMain(ctx context.Context) {
148149
"VOLUMES",
149150
"STATUS",
150151
}
151-
if wideOutput {
152-
headers = append(headers, "DRIVE ID")
153-
}
154152
if showLabels {
155153
headers = append(headers, "LABELS")
156154
}
@@ -199,6 +197,7 @@ func listDrivesMain(ctx context.Context) {
199197
driveMake = "-"
200198
}
201199
row := []interface{}{
200+
drive.GetDriveID(),
202201
drive.GetNodeID(),
203202
drive.GetDriveName(),
204203
driveMake,
@@ -207,9 +206,6 @@ func listDrivesMain(ctx context.Context) {
207206
volumes,
208207
status,
209208
}
210-
if wideOutput {
211-
row = append(row, drive.GetDriveID())
212-
}
213209
if showLabels {
214210
row = append(row, labelsToString(drive.GetLabels()))
215211
}

docs/drive-management.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ To get information of drives from DirectPV, run the `list drives` command. Below
7373

7474
```sh
7575
$ kubectl directpv list drives
76-
┌────────┬──────┬──────┬──────────────────┬─────────┬────────┐
77-
│ NODE │ NAME │ MAKE │ SIZE │ FREE │ VOLUMES │ STATUS │
78-
├────────┼──────┼──────┼──────────────────┼─────────┼────────┤
79-
│ master │ vdb │ - │ 512 MiB │ 506 MiB │ - │ Ready │
80-
│ node1 │ vdb │ - │ 512 MiB │ 506 MiB │ - │ Ready │
81-
└────────┴──────┴──────┴──────────────────┴─────────┴────────┘
76+
┌──────────────────────────────────────┬────────┬──────┬───────────────┬─────────┬───────────┬─────────┬────────┐
77+
DRIVE ID │ NODE │ NAME │ MAKE │ SIZE │ FREE │ ALLOCATED │ VOLUMES │ STATUS │
78+
├──────────────────────────────────────┼────────┼──────┼───────────────┼─────────┼───────────┼─────────┼────────┤
79+
1b94751e-f97a-4cd0-89b6-af2c7657a8e7 │ master │ vdb │ - │ 512 MiB │ 512 MiB │ - │ - │ Ready │
80+
b3e44552-a3b8-4233-bf78-ccff05956804 │ node1 │ vdb │ - │ 512 MiB │ 512 MiB │ - │ - │ Ready │
81+
└──────────────────────────────────────┴────────┴──────┴───────────────┴─────────┴───────────┴─────────┴────────┘
8282
```
8383

8484
Refer to the [list drives command](./command-reference.md#drives-command) for more information.

docs/volume-management.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ To get information of volumes from DirectPV, run the `list volumes` command. Bel
1313

1414
```sh
1515
$ kubectl directpv list drives
16-
┌────────┬──────┬──────┬──────────────────┬─────────┬────────┐
17-
│ NODE │ NAME │ MAKE │ SIZE │ FREE │ VOLUMES │ STATUS │
18-
├────────┼──────┼──────┼──────────────────┼─────────┼────────┤
19-
│ master │ vdb │ - │ 512 MiB │ 506 MiB │ - │ Ready │
20-
│ node1 │ vdb │ - │ 512 MiB │ 506 MiB │ - │ Ready │
21-
└────────┴──────┴──────┴──────────────────┴─────────┴────────┘
16+
┌──────────────────────────────────────┬────────┬──────┬───────────────┬─────────┬───────────┬─────────┬────────┐
17+
DRIVE ID │ NODE │ NAME │ MAKE │ SIZE │ FREE │ ALLOCATED │ VOLUMES │ STATUS │
18+
├──────────────────────────────────────┼────────┼──────┼───────────────┼─────────┼───────────┼─────────┼────────┤
19+
1b94751e-f97a-4cd0-89b6-af2c7657a8e7 │ master │ vdb │ - │ 512 MiB │ 512 MiB │ - │ - │ Ready │
20+
b3e44552-a3b8-4233-bf78-ccff05956804 │ node1 │ vdb │ - │ 512 MiB │ 512 MiB │ - │ - │ Ready │
21+
└──────────────────────────────────────┴────────┴──────┴───────────────┴─────────┴───────────┴─────────┴────────┘
2222
```
2323

2424
Refer to the [list volumes command](./command-reference.md#volumes-command) for more information.

0 commit comments

Comments
 (0)