fix(sdk): Include status message in watcher wait debug logging

The status watcher already emits debug logs when waiting for resources
to become ready, but omits the detailed message from the kstatus library.
This makes SDK debugging harder since users only see status codes like
"InProgress" without context such as "Replicas: 1/2" or "Ready: 0/2".

Include the Message field in the debug log output so SDK consumers
configuring slog with debug level get the detailed resource status
information they expect.

Fixes #31585

Signed-off-by: Oleg Pustovit <oleg@nexo.sh>
pull/31708/head
Oleg Pustovit 3 days ago
parent 05f25a3834
commit 45a7040f16

@ -246,7 +246,7 @@ func statusObserver(cancel context.CancelFunc, desired status.Status) collector.
return nonDesiredResources[i].Identifier.Name < nonDesiredResources[j].Identifier.Name
})
first := nonDesiredResources[0]
slog.Debug("waiting for resource", "namespace", first.Identifier.Namespace, "name", first.Identifier.Name, "kind", first.Identifier.GroupKind.Kind, "expectedStatus", desired, "actualStatus", first.Status)
slog.Debug("waiting for resource", "namespace", first.Identifier.Namespace, "name", first.Identifier.Name, "kind", first.Identifier.GroupKind.Kind, "expectedStatus", desired, "actualStatus", first.Status, "message", first.Message)
}
}
}

Loading…
Cancel
Save