Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for fatal error in diagnostics (#1715) #1740

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading