diff --git a/gwctl/pkg/printer/backends.go b/gwctl/pkg/printer/backends.go index b391217ee0..2c3481ccac 100644 --- a/gwctl/pkg/printer/backends.go +++ b/gwctl/pkg/printer/backends.go @@ -170,6 +170,11 @@ func (bp *BackendsPrinter) PrintDescribeView(resourceModel *resourcediscovery.Re pairs = append(pairs, &DescriberKV{Key: "ReferenceGrants", Value: names}) } + // Analysis + if len(backendNode.Errors) != 0 { + pairs = append(pairs, &DescriberKV{Key: "Analysis", Value: convertErrorsToString(backendNode.Errors)}) + } + // Events pairs = append(pairs, &DescriberKV{Key: "Events", Value: convertEventsSliceToTable(backendNode.Events, bp.Clock)}) diff --git a/gwctl/pkg/printer/common.go b/gwctl/pkg/printer/common.go index bd9792e3c9..1ca1123df3 100644 --- a/gwctl/pkg/printer/common.go +++ b/gwctl/pkg/printer/common.go @@ -171,6 +171,14 @@ func convertPolicyRefsToTable(policyRefs []common.ObjRef) *Table { return table } +func convertErrorsToString(errors []error) []string { + var result []string + for _, err := range errors { + result = append(result, err.Error()) + } + return result +} + type NodeResource interface { ClientObject() client.Object } diff --git a/gwctl/pkg/printer/gateways.go b/gwctl/pkg/printer/gateways.go index 3b30c180b7..33b710a3ae 100644 --- a/gwctl/pkg/printer/gateways.go +++ b/gwctl/pkg/printer/gateways.go @@ -135,6 +135,11 @@ func (gp *GatewaysPrinter) PrintDescribeView(resourceModel *resourcediscovery.Re pairs = append(pairs, &DescriberKV{Key: "EffectivePolicies", Value: gatewayNode.EffectivePolicies}) } + // Analysis + if len(gatewayNode.Errors) != 0 { + pairs = append(pairs, &DescriberKV{Key: "Analysis", Value: convertErrorsToString(gatewayNode.Errors)}) + } + // Events pairs = append(pairs, &DescriberKV{Key: "Events", Value: convertEventsSliceToTable(gatewayNode.Events, gp.Clock)})