mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
QAT: make plugin read trimmed heartbeat status
Plugin used to consider only the value "-1" but there are some cases when files show "\n" or "\n\x00". This makes plugin to have wrong status of the device. So, trim the value after \n so only numerical value can be read. Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
This commit is contained in:
parent
5c8faeae17
commit
ea6d52d443
@ -416,7 +416,7 @@ func getDeviceHealthiness(device string, lookup map[string]string) string {
|
|||||||
|
|
||||||
// If status reads "-1", the device is considered bad:
|
// If status reads "-1", the device is considered bad:
|
||||||
// https://github.com/torvalds/linux/blob/v6.6-rc5/Documentation/ABI/testing/debugfs-driver-qat
|
// https://github.com/torvalds/linux/blob/v6.6-rc5/Documentation/ABI/testing/debugfs-driver-qat
|
||||||
if data, err := os.ReadFile(hbStatusFile); err == nil && string(data) == "-1" {
|
if data, err := os.ReadFile(hbStatusFile); err == nil && strings.Split(string(data), "\n")[0] == "-1" {
|
||||||
healthiness = pluginapi.Unhealthy
|
healthiness = pluginapi.Unhealthy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user