fix check errRaw != nil but return a nil value error err

This commit is contained in:
alingse 2024-12-17 20:45:17 +08:00 committed by GitHub
parent 3ec97a445f
commit b963e1514e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -325,7 +325,7 @@ func GetKubeletHeapStats(ctx context.Context, c clientset.Interface, nodeName st
}
raw, errRaw := client.Raw()
if errRaw != nil {
return "", err
return "", errRaw
}
kubeletstatsv1alpha1 := string(raw)
// Only dumping the runtime.MemStats numbers to avoid polluting the log.