Skip to content

Commit cdaabe3

Browse files
committed
print scope and owner
Signed-off-by: Lukas Hoehl <lukas.hoehl@stackit.cloud>
1 parent 8c17100 commit cdaabe3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

internal/cmd/image/list/list.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,16 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APICli
151151
func outputResult(p *print.Printer, outputFormat string, items []iaas.Image) error {
152152
return p.OutputResult(outputFormat, items, func() error {
153153
table := tables.NewTable()
154-
table.SetHeader("ID", "NAME", "OS", "ARCHITECTURE", "DISTRIBUTION", "VERSION", "LABELS")
154+
table.SetHeader("ID", "NAME", "OS", "ARCHITECTURE", "DISTRIBUTION", "VERSION", "SCOPE", "OWNER", "LABELS")
155155
for i := range items {
156156
item := items[i]
157157
var (
158158
architecture = "n/a"
159159
os = "n/a"
160160
distro = "n/a"
161161
version = "n/a"
162+
owner = "n/a"
163+
scope = "n/a"
162164
)
163165
if cfg := item.Config; cfg != nil {
164166
if v := cfg.Architecture; v != nil {
@@ -174,12 +176,21 @@ func outputResult(p *print.Printer, outputFormat string, items []iaas.Image) err
174176
version = *v.Get()
175177
}
176178
}
179+
if v := item.GetOwner(); v != "" {
180+
owner = v
181+
}
182+
if v := item.GetScope(); v != "" {
183+
scope = v
184+
}
185+
177186
table.AddRow(utils.PtrString(item.Id),
178187
utils.PtrString(item.Name),
179188
os,
180189
architecture,
181190
distro,
182191
version,
192+
scope,
193+
owner,
183194
utils.JoinStringKeysPtr(*item.Labels, ","))
184195
}
185196
err := table.Display(p)

0 commit comments

Comments
 (0)