Skip to content

Commit

Permalink
Improve error message and formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
samfreiberg-oh committed Aug 24, 2021
1 parent cc03e13 commit 03fc637
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controllers/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (r *NodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.

status, err := getNodeReadyCondition(node.Status.Conditions)
if err != nil {
logger.Error(err, "Something has gone horribly wrong.")
logger.Error(err, "Unable to get node ready condition.")
return ctrl.Result{}, err
}

Expand Down Expand Up @@ -117,7 +117,12 @@ func (r *NodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.

shouldDelete := !nodeExists || nodeShutdown

logger.Info("Node condition matches unhealthy criteria", "nodeExists", nodeExists, "nodeShutdown", nodeShutdown, "shouldDelete", shouldDelete)
logger.Info(
"Node condition matches unhealthy criteria",
"nodeExists", nodeExists,
"nodeShutdown", nodeShutdown,
"shouldDelete", shouldDelete,
)

if !nodeExists {
logger.Info("Deleting node because it does not exist in the cloud provider")
Expand Down

0 comments on commit 03fc637

Please sign in to comment.