Skip to content

Commit 25e9c9f

Browse files
committed
add labels to describe table output
1 parent 5eca6cb commit 25e9c9f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/cmd/beta/volume/describe/describe.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"strings"
78

89
"github.com/goccy/go-yaml"
910

@@ -145,6 +146,14 @@ func outputResult(p *print.Printer, outputFormat string, volume *iaas.Volume) er
145146
table.AddSeparator()
146147
}
147148

149+
if volume.Labels != nil && len(*volume.Labels) > 0 {
150+
labels := []string{}
151+
for key, value := range *volume.Labels {
152+
labels = append(labels, fmt.Sprintf("%s: %s", key, value))
153+
}
154+
table.AddRow("LABELS", strings.Join(labels, "\n"))
155+
}
156+
148157
err := table.Display(p)
149158
if err != nil {
150159
return fmt.Errorf("render table: %w", err)

0 commit comments

Comments
 (0)