From c6f10710d09607122189ff67a5781dda42867249 Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Thu, 27 Jan 2022 16:34:57 +0530 Subject: [PATCH] controller/reclaimspacejob: skip making node req if nodeID is empty Node reclaimspace request should not be made when nodeID is empty indicating the pvc is not mounted to any pod. Signed-off-by: Rakshith R --- controllers/reclaimspacejob_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/reclaimspacejob_controller.go b/controllers/reclaimspacejob_controller.go index 86fc23fbc..c005fe1b2 100644 --- a/controllers/reclaimspacejob_controller.go +++ b/controllers/reclaimspacejob_controller.go @@ -376,6 +376,11 @@ func (r *ReclaimSpaceJobReconciler) nodeReclaimSpace( ctx context.Context, logger *logr.Logger, target *targetDetails) (bool, *int64, error) { + if target.nodeID == "" { + logger.Info("NodeID not found, skipping node reclaimspace") + + return false, nil, nil + } clientName, nodeClient := r.getRSClientWithCap( target.driverName, target.nodeID,