Skip to content

Commit 3aba5ca

Browse files
authored
Merge pull request #17 from civo/fix/fix-log-message
Unify log formatting and add new log messages
2 parents baffa25 + ce25237 commit 3aba5ca

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pkg/watcher/watcher.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,27 @@ func isNodeReady(node *corev1.Node) bool {
212212

213213
func isNodeDesiredGPU(node *corev1.Node, desired int) bool {
214214
if desired == 0 {
215-
slog.Info("desired gpu count is set to 0", "node", node.GetName())
215+
slog.Info("Desired GPU count is set to 0", "node", node.GetName())
216216
return true
217217
}
218218

219219
quantity, exists := node.Status.Allocatable[gpuResourceName]
220220
if !exists || quantity.IsZero() {
221-
slog.Info("read allocatable gpus", "node", node.GetName(), "count", quantity.String())
221+
slog.Info("Allocatable GPU not found", "node", node.GetName())
222222
return false
223223
}
224224

225225
gpuCount, ok := quantity.AsInt64()
226226
if !ok {
227+
slog.Info("Failed to convert allocatable GPU quantity to int64", "node", node.GetName(), "quantity", quantity.String())
227228
return false
228229
}
230+
231+
slog.Info("Checking actual GPU count with desired",
232+
"node", node.GetName(),
233+
"actual", gpuCount,
234+
"desired", strconv.Itoa(desired))
235+
229236
return gpuCount == int64(desired)
230237
}
231238

0 commit comments

Comments
 (0)