从pod annotations获取信息挂载device new 8

This commit is contained in:
funnyfunny
2023-08-15 09:59:36 +08:00
parent 1610d20826
commit ba9d51dfd5

View File

@@ -501,8 +501,8 @@ func addDevice(spec *specs.Spec) error {
// 获取对应pod annotation中的设备信息
annotationDevices, err := getDeviceFromPod(spec)
if err != nil && err != notMatchError {
// 报错不可直接返回,记录日志即可
hwlog.RunLog.Errorf("getDeviceFromPod failed: %#v", err)
//return fmt.Errorf("failed to get pod device: %#v", err)
}
// 如果没有匹配到pod或annotation则通过环境变量挂载设备
@@ -771,4 +771,4 @@ func getDeviceFromPod(spec *specs.Spec) (string, error) {
}
}
return "", notMatchError
}
}7