dra kubelet: fix error log

Previously we were returning the error string from 'err' (which is nil), when
we should have been returning it from result.Error. Without this it is hard to
debug issues with NodeUnprepareResources.

Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
Kevin Klues 2024-03-11 13:51:29 +00:00
parent b3926d137c
commit fc2134c84c

View File

@ -380,7 +380,7 @@ func (m *ManagerImpl) UnprepareResources(pod *v1.Pod) error {
return fmt.Errorf("NodeUnprepareResources returned result for unknown claim UID %s", claimUID) return fmt.Errorf("NodeUnprepareResources returned result for unknown claim UID %s", claimUID)
} }
if result.Error != "" { if result.Error != "" {
return fmt.Errorf("NodeUnprepareResources failed for claim %s/%s: %s", reqClaim.Namespace, reqClaim.Name, err) return fmt.Errorf("NodeUnprepareResources failed for claim %s/%s: %s", reqClaim.Namespace, reqClaim.Name, result.Error)
} }
// Delete last pod UID only if unprepare succeeds. // Delete last pod UID only if unprepare succeeds.