Skip to content

Commit baf91fb

Browse files
committed
feat(alb): add list of errors to describe output
1 parent 409d6a7 commit baf91fb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

internal/cmd/beta/alb/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/stackitcloud/stackit-cli/internal/pkg/utils"
910

@@ -132,6 +133,14 @@ func outputResult(p *print.Printer, outputFormat string, response *alb.LoadBalan
132133
table.AddRow("STATUS", utils.PtrString(response.Status))
133134
table.AddSeparator()
134135
table.AddRow("VERSION", utils.PtrString(response.Version))
136+
if response.Errors != nil {
137+
table.AddSeparator()
138+
var builder strings.Builder
139+
for _, err := range *response.Errors {
140+
builder.WriteString(fmt.Sprintf("[%s] %s\n", utils.PtrString(err.Type), utils.PtrString(err.Description)))
141+
}
142+
table.AddRow("ERRORS", builder.String())
143+
}
135144

136145
p.Outputln(table.Render())
137146
}

internal/cmd/beta/alb/list/list.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ func outputResult(p *print.Printer, outputFormat string, items []alb.LoadBalance
161161
utils.PtrString(item.Region),
162162
utils.PtrString(item.Status),
163163
utils.PtrString(item.Version),
164-
utils.PtrString(item.ExternalAddress),
165164
)
166165
}
167166
err := table.Display(p)

0 commit comments

Comments
 (0)