From 57fac0699978f190be90d21d0436b7620836ed5c Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 5 Mar 2025 17:45:09 +0900 Subject: [PATCH] fix: log message and add log Signed-off-by: hlts2 --- pkg/watcher/watcher.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/watcher/watcher.go b/pkg/watcher/watcher.go index 5291216..0f3d60f 100644 --- a/pkg/watcher/watcher.go +++ b/pkg/watcher/watcher.go @@ -212,20 +212,27 @@ func isNodeReady(node *corev1.Node) bool { func isNodeDesiredGPU(node *corev1.Node, desired int) bool { if desired == 0 { - slog.Info("desired gpu count is set to 0", "node", node.GetName()) + slog.Info("Desired GPU count is set to 0", "node", node.GetName()) return true } quantity, exists := node.Status.Allocatable[gpuResourceName] if !exists || quantity.IsZero() { - slog.Info("read allocatable gpus", "node", node.GetName(), "count", quantity.String()) + slog.Info("Allocatable GPU not found", "node", node.GetName()) return false } gpuCount, ok := quantity.AsInt64() if !ok { + slog.Info("Failed to convert allocatable GPU quantity to int64", "node", node.GetName(), "quantity", quantity.String()) return false } + + slog.Info("Checking actual GPU count with desired", + "node", node.GetName(), + "actual", gpuCount, + "desired", strconv.Itoa(desired)) + return gpuCount == int64(desired) }