From 280c10a6e454b20c7a1b20004d36244313d020df Mon Sep 17 00:00:00 2001 From: "Jose R. Gonzalez" Date: Wed, 24 Apr 2024 15:10:05 -0500 Subject: [PATCH] Output unavailable resources (#436) Co-authored-by: rosecrisp --- internal/tool/kubectl.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/tool/kubectl.go b/internal/tool/kubectl.go index fd24e7b1..6579476a 100644 --- a/internal/tool/kubectl.go +++ b/internal/tool/kubectl.go @@ -127,11 +127,14 @@ func (k Kubectl) WaitForWorkloadResources(context context.Context, namespace str return errors.New(errorMsg) } if len(unavailableWorkloadResources) > 0 { - errorMsg := "error unavailable workload resources, timeout has expired, please consider increasing the timeout using the chart-verifier --timeout flag" + // Initialize errorMsg + errorMsg := "error unavailable workload resources, timeout has expired, please consider increasing the timeout using the chart-verifier --timeout flag. Unavailable resources: " + for _, unavailableWorkloadResource := range unavailableWorkloadResources { + errorMsg += fmt.Sprintf("%s/%s, ", unavailableWorkloadResource.ResourceType, unavailableWorkloadResource.Name) + } utils.LogError(errorMsg) return errors.New(errorMsg) } - return nil }