From a632b5dc5b85f04227f17184671fd33bc90b2ac8 Mon Sep 17 00:00:00 2001 From: cardyok Date: Wed, 12 Mar 2025 17:41:48 +0800 Subject: [PATCH] fix(xid/sxid): update state error base on xid/sxid name Signed-off-by: cardyok --- components/accelerator/nvidia/sxid/helper.go | 4 ++-- components/accelerator/nvidia/xid/helper.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/accelerator/nvidia/sxid/helper.go b/components/accelerator/nvidia/sxid/helper.go index e305cec4..202711fe 100644 --- a/components/accelerator/nvidia/sxid/helper.go +++ b/components/accelerator/nvidia/sxid/helper.go @@ -86,8 +86,8 @@ func EvolveHealthyState(events []components.Event) (ret components.State) { reason = "SXIDComponent is healthy" } else { reason = fmt.Sprintf("sxid %d detected by %s", lastSXidErr.SXid, lastSXidErr.DataSource) - if lastSuggestedAction != nil && len(lastSuggestedAction.RepairActions) > 0 { - stateError += fmt.Sprintf("Suggestion: %s", lastSuggestedAction.RepairActions[0]) + if sxidDetail, ok := nvidia_query_sxid.GetDetail(int(lastSXidErr.SXid)); ok { + stateError = sxidDetail.Name } } return components.State{ diff --git a/components/accelerator/nvidia/xid/helper.go b/components/accelerator/nvidia/xid/helper.go index 7103a045..5e5708a1 100644 --- a/components/accelerator/nvidia/xid/helper.go +++ b/components/accelerator/nvidia/xid/helper.go @@ -86,8 +86,8 @@ func EvolveHealthyState(events []components.Event) (ret components.State) { reason = "XIDComponent is healthy" } else { reason = fmt.Sprintf("xid %d detected by %s", lastXidErr.Xid, lastXidErr.DataSource) - if lastSuggestedAction != nil && len(lastSuggestedAction.RepairActions) > 0 { - stateError += fmt.Sprintf("Suggestion: %s", lastSuggestedAction.RepairActions[0]) + if xidDetail, ok := nvidia_query_xid.GetDetail(int(lastXidErr.Xid)); ok { + stateError = xidDetail.Name } } return components.State{