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 720a565
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/diagnostics/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ func GetHwInfoAllNodes() (out map[string]NodeHwInfo) {
hw := NodeHwInfo{}
lscpu, err := getHWJsonOutput(debugPod, o, lscpuCommand)
if err != nil {
logrus.Errorf("problem getting lscpu for node %s", debugPod.Spec.NodeName)
logrus.Error("problem getting lscpu for node %s", debugPod.Spec.NodeName)

Check failure on line 88 in pkg/diagnostics/diagnostics.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

github.com/sirupsen/logrus.Error call has possible Printf formatting directive %s

Check failure on line 88 in pkg/diagnostics/diagnostics.go

View workflow job for this annotation

GitHub Actions / Run Linters and Vet

printf: github.com/sirupsen/logrus.Error call has possible Printf formatting directive %s (govet)
} else {
var ok bool
temp, ok := lscpu.(map[string]interface{})
if !ok {
logrus.Error("problem casting lscpu field for node %s, lscpu=%v", debugPod.Spec.NodeName, lscpu)

Check failure on line 93 in pkg/diagnostics/diagnostics.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

github.com/sirupsen/logrus.Error call has possible Printf formatting directive %s

Check failure on line 93 in pkg/diagnostics/diagnostics.go

View workflow job for this annotation

GitHub Actions / Run Linters and Vet

printf: github.com/sirupsen/logrus.Error call has possible Printf formatting directive %s (govet)
} 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 720a565

Please sign in to comment.