From e0bfd682e881acafb64d64ee991f654f65f0e862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Burzy=C5=84ski?= Date: Tue, 31 Oct 2023 14:12:54 +0100 Subject: [PATCH] fix: use debug level for readiness checks logs (#5029) (#5030) (cherry picked from commit afe12ed7a15299de3343132002c2451fe8aa42cb) --- internal/clients/readiness.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/clients/readiness.go b/internal/clients/readiness.go index 0eb388101a..b2e7678f50 100644 --- a/internal/clients/readiness.go +++ b/internal/clients/readiness.go @@ -105,7 +105,10 @@ func (c DefaultReadinessChecker) checkPendingClient( client, err := c.factory.CreateAdminAPIClient(ctx, pendingClient) if err != nil { // Despite the error reason we still want to keep the client in the pending list to retry later. - c.logger.V(util.DebugLevel).Error(err, fmt.Sprintf("pending client for %q is not ready yet", pendingClient.Address)) + c.logger.V(util.DebugLevel).Info("pending client is not ready yet", + "reason", err.Error(), + "address", pendingClient.Address, + ) return nil } @@ -123,7 +126,8 @@ func (c DefaultReadinessChecker) checkAlreadyExistingClients(ctx context.Context // This should never happen, but if it does, we want to log it. c.logger.Error( errors.New("missing pod reference"), - fmt.Sprintf("failed to get PodReference for client %q", client.BaseRootURL()), + "failed to get PodReference for client", + "address", client.BaseRootURL(), ) continue } @@ -148,9 +152,10 @@ func (c DefaultReadinessChecker) checkAlreadyCreatedClient(ctx context.Context, defer cancel() if err := client.IsReady(ctx); err != nil { // Despite the error reason we still want to keep the client in the pending list to retry later. - c.logger.V(util.DebugLevel).Error( - err, - fmt.Sprintf("already created client for %q is not ready, moving to pending", client.BaseRootURL()), + c.logger.V(util.DebugLevel).Info( + "already created client is not ready, moving to pending", + "address", client.BaseRootURL(), + "reason", err.Error(), ) return false }