From 61534246b426f3c60ee1735a6fb3ad863fbec03a Mon Sep 17 00:00:00 2001 From: Walter Boring Date: Fri, 5 Jun 2026 09:52:40 -0400 Subject: [PATCH] [cinder-csi-plugin] Fix ControllerGetVolume multi-cloud iteration bug In ControllerGetVolume, when multiple clouds are configured, the loop iterates over all clouds without breaking on success. If the volume is found in an earlier cloud but a subsequent cloud returns NotFound, the err variable is overwritten and the function erroneously returns NotFound despite having already located the volume. Add a break statement after a successful GetVolume call to stop iterating once the volume is found. Signed-off-by: Walter Boring --- pkg/csi/cinder/controllerserver.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/csi/cinder/controllerserver.go b/pkg/csi/cinder/controllerserver.go index 1a1b9e2ff6..f5b18c35a7 100644 --- a/pkg/csi/cinder/controllerserver.go +++ b/pkg/csi/cinder/controllerserver.go @@ -952,6 +952,7 @@ func (cs *controllerServer) ControllerGetVolume(ctx context.Context, req *csi.Co } return nil, status.Errorf(codes.Internal, "ControllerGetVolume failed with error %v", err) } + break } if err != nil { return nil, status.Errorf(codes.NotFound, "Volume %s not found", volumeID)