From 9acf08f548b07a1445bc93ab157c5f83150a7e9b Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 22 Apr 2026 10:46:16 +0300 Subject: [PATCH] kubelet/dra: fix error check in unprepareResources GetPlugin returns (nil, error) on failure. The error check was comparing the plugin pointer to nil instead of checking the error, which is inconsistent with the identical call in prepareResources and could mask the actual error in future refactors. --- pkg/kubelet/cm/dra/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/cm/dra/manager.go b/pkg/kubelet/cm/dra/manager.go index ea468f57877..3ed6b856890 100644 --- a/pkg/kubelet/cm/dra/manager.go +++ b/pkg/kubelet/cm/dra/manager.go @@ -665,7 +665,7 @@ func (m *Manager) unprepareResources(ctx context.Context, podUID types.UID, name for driverName, claims := range batches { // Call NodeUnprepareResources RPC for all resource handles. plugin, err := m.draPlugins.GetPlugin(driverName) - if plugin == nil { + if err != nil { // No wrapping, error includes driver name already. return err }