[cinder-csi-plugin] Fix ControllerGetVolume multi-cloud iteration bug#3121
[cinder-csi-plugin] Fix ControllerGetVolume multi-cloud iteration bug#3121hemna wants to merge 1 commit into
Conversation
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 <waboring@hemna.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @hemna. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
What this PR does / why we need it:
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 returnsNotFound, theerrvariable is overwritten and the function erroneously returnsNotFounddespite having already located the volume.This adds a
breakstatement after a successfulGetVolumecall to stop iterating once the volume is found.Which issue this PR fixes(if applicable):
fixes #
Special notes for reviewers:
Only affects multi-cloud configurations. Single-cloud setups are unaffected since the loop has only one iteration.
Release note: