File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
internal/cmd/load-balancer/describe Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 4
4
"context"
5
5
"encoding/json"
6
6
"fmt"
7
+ "strings"
7
8
8
9
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
9
10
"github.com/stackitcloud/stackit-cli/internal/pkg/errors"
@@ -153,11 +154,22 @@ func renderLoadBalancer(loadBalancer *loadbalancer.LoadBalancer) string {
153
154
externalAdress = * loadBalancer .ExternalAddress
154
155
}
155
156
157
+ errorDescriptions := []string {}
158
+ if loadBalancer .Errors != nil && len ((* loadBalancer .Errors )) > 0 {
159
+ for _ , err := range * loadBalancer .Errors {
160
+ errorDescriptions = append (errorDescriptions , * err .Description )
161
+ }
162
+ }
163
+
156
164
table := tables .NewTable ()
157
165
table .AddRow ("NAME" , * loadBalancer .Name )
158
166
table .AddSeparator ()
159
167
table .AddRow ("STATE" , * loadBalancer .Status )
160
168
table .AddSeparator ()
169
+ if len (errorDescriptions ) > 0 {
170
+ table .AddRow ("ERROR DESCRIPTIONS" , strings .Join (errorDescriptions , "\n " ))
171
+ table .AddSeparator ()
172
+ }
161
173
table .AddRow ("PRIVATE ACCESS ONLY" , privateAccessOnly )
162
174
table .AddSeparator ()
163
175
table .AddRow ("ATTACHED PUBLIC IP" , externalAdress )
You can’t perform that action at this time.
0 commit comments