From 8762d280b16daf4437e85b303f23bab2a4464458 Mon Sep 17 00:00:00 2001 From: wangxiaofei67 Date: Thu, 26 Sep 2024 20:53:57 +0800 Subject: [PATCH] fix: when the "getIndex" fails, display more data details in logs. Signed-off-by: wangxiaofei67 fix: add signoff Signed-off-by: wangxiaofei67 fix: optimize prompt messages in the logs --- pkg/modeling/modeling.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/modeling/modeling.go b/pkg/modeling/modeling.go index 5564a1beb..9e4842cae 100644 --- a/pkg/modeling/modeling.go +++ b/pkg/modeling/modeling.go @@ -163,7 +163,7 @@ func (rs *ResourceSummary) clusterResourceNodeComparator(a, b interface{}) int { func (rs *ResourceSummary) AddToResourceSummary(crn ClusterResourceNode) { index := rs.getIndex(crn) if index == -1 { - klog.Error("ClusterResource can not add to resource summary: index is invalid.") + klog.Errorf("Failed to add node to resource summary due to no appropriate grade. ClusterResourceNode:%v", crn) return } modeling := &(*rs).RMs[index]