Skip to content

Commit 4d83b46

Browse files
committed
TEMP: add debug logging for Healthy condition troubleshooting
1 parent 99f2c1a commit 4d83b46

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

internal/controller/metal3.io/baremetalhost_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ func (r *BareMetalHostReconciler) Reconcile(ctx context.Context, request ctrl.Re
248248
copy(conditionsBefore, existing)
249249
computeConditions(ctx, host, prov)
250250
conditionsChanged := !reflect.DeepEqual(conditionsBefore, host.GetConditions())
251+
info.log.Info("conditions check",
252+
"dirty", actResult.Dirty(),
253+
"conditionsChanged", conditionsChanged,
254+
"conditionsBefore", len(conditionsBefore),
255+
"conditionsAfter", len(host.GetConditions()))
251256

252257
// Only save status when we're told to, otherwise we
253258
// introduce an infinite loop reconciling the same object over and

pkg/provisioner/ironic/ironic.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,12 +2002,16 @@ func (p *ironicProvisioner) HasPowerFailure(ctx context.Context) bool {
20022002
// request to Ironic on every reconcile. Consider passing the node object through
20032003
// computeConditions or caching it per reconcile cycle to avoid redundant calls.
20042004
func (p *ironicProvisioner) GetHealth(ctx context.Context) string {
2005+
p.log.Info("GetHealth called", "nodeID", p.nodeID, "hasHealthAPI", p.availableFeatures.HasHealthAPI(), "maxVersion", p.availableFeatures.MaxVersion)
20052006
node, err := p.getNode(ctx)
20062007
if err != nil {
2007-
if !errors.Is(err, provisioner.ErrNeedsRegistration) {
2008-
p.log.Error(err, "ignored error while checking health status")
2008+
if errors.Is(err, provisioner.ErrNeedsRegistration) {
2009+
p.log.Info("GetHealth: node not registered yet")
2010+
} else {
2011+
p.log.Error(err, "GetHealth: getNode failed")
20092012
}
20102013
return ""
20112014
}
2015+
p.log.Info("GetHealth result", "health", node.Health, "nodeUUID", node.UUID, "provisionState", node.ProvisionState)
20122016
return node.Health
20132017
}

0 commit comments

Comments
 (0)