Skip to content

Commit

Permalink
fix: use debug level for readiness checks logs (#5029) (#5030)
Browse files Browse the repository at this point in the history
(cherry picked from commit afe12ed)
  • Loading branch information
czeslavo committed Oct 31, 2023
1 parent ef5b25c commit e0bfd68
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions internal/clients/readiness.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit e0bfd68

Please sign in to comment.