Skip to content

Commit

Permalink
Fix for fatal error in diagnostics (#1715)
Browse files Browse the repository at this point in the history
  • Loading branch information
edcdavid committed Dec 15, 2023
1 parent a86a981 commit 0ff0572
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/diagnostics/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ func GetHwInfoAllNodes() (out map[string]NodeHwInfo) {
lscpu, err := getHWJsonOutput(debugPod, o, lscpuCommand)
if err != nil {
logrus.Errorf("problem getting lscpu for node %s", debugPod.Spec.NodeName)
} else {
var ok bool
temp, ok := lscpu.(map[string]interface{})
if !ok {
logrus.Errorf("problem casting lscpu field for node %s, lscpu=%v", debugPod.Spec.NodeName, lscpu)
} else {
hw.Lscpu = temp["lscpu"]
}
}
var ok bool
hw.Lscpu, ok = lscpu.(map[string]interface{})["lscpu"]
if !ok {
logrus.Errorf("problem casting lscpu field for node %s, lscpu=%v", debugPod.Spec.NodeName, lscpu)
}

hw.IPconfig, err = getHWJsonOutput(debugPod, o, ipCommand)
if err != nil {
logrus.Errorf("problem getting ip config for node %s", debugPod.Spec.NodeName)
Expand Down

0 comments on commit 0ff0572

Please sign in to comment.