Skip to content

Commit

Permalink
chore: improve log message output and consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Dustin Scott <dscott@redhat.com>
  • Loading branch information
scottd018 committed Jul 12, 2023
1 parent c1d6053 commit 3852ea1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion controllers/phases/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ func HandleClusterPhase(
if cluster.State() != clustersmgmtv1.ClusterStateReady {
logger.Info(
fmt.Sprintf(
"cluster [%s] with state [%s] is not ready...requeueing",
"cluster [%s] with state [%s] is not ready",
req.GetClusterName(),
cluster.State(),
), request.LogValues(req)...)
logger.Info(fmt.Sprintf("checking again in %s", defaultMissingUpstreamRequeue.String()), request.LogValues(req)...)

return requeue.After(defaultMissingUpstreamRequeue, nil)
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/reconcilers/machinepool/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (req *MachinePoolRequest) updateNodePool(poolClient *ocm.NodePoolClient) er
// deleteMachinePool deletes a machine pool object in OCM.
func (req *MachinePoolRequest) deleteMachinePool(poolClient *ocm.MachinePoolClient) error {
if err := poolClient.Delete(req.Desired.Spec.DisplayName); err != nil {
return fmt.Errorf("unable to update machine pool - %w", err)
return fmt.Errorf("unable to delete machine pool - %w", err)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions controllers/reconcilers/rosacluster/phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ func (r *Controller) WaitUntilReady(req *ROSAClusterRequest) (ctrl.Result, error

return phases.Next()
case clustersmgmtv1.ClusterStateError:
req.Log.Error(fmt.Errorf("cluster is in error state"), fmt.Sprintf(
req.Log.Error(fmt.Errorf("cluster has error state"), fmt.Sprintf(
"checking again in %s", req.provisionRequeueTime().String(),
), request.LogValues(req)...)

return requeue.After(req.provisionRequeueTime(), nil)
default:
req.Log.Info("cluster is not ready", request.LogValues(req)...)
req.Log.Info(fmt.Sprintf("cluster with state [%s] is not ready", req.Cluster.State()), request.LogValues(req)...)
req.Log.Info(fmt.Sprintf("checking again in %s", req.provisionRequeueTime().String()), request.LogValues(req)...)

return requeue.After(req.provisionRequeueTime(), nil)
Expand Down

0 comments on commit 3852ea1

Please sign in to comment.