NVIDIA / k8s-dra-driver

Dynamic Resource Allocation (DRA) for NVIDIA GPUs in Kubernetes
Apache License 2.0
195 stars 36 forks source link

Add proper implementation of UnprepareResources in kubelet plugin #109

Closed klueska closed 2 months ago

klueska commented 2 months ago

Previously, we always returned SUCCESS from every call to UnprepareResources, regardless of whether we successfully unprepared the claim or not. The idea being that we would always garbage collect it later, once the claim got deallocated by the controller.

This commit changes the semantics to carry out the unprepare at the point it is actually requested, returning an error if this is not possible for some reason. In the past, such errors would have been missed, and the resources could have been deallocated prematurely.