From cd2eea12867fa8737b29001e44c2e263455aec68 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Wed, 7 Apr 2021 09:48:40 -0400 Subject: [PATCH] CSI: fix early return on error from list external volumes command If a plugin returns an error, we should continue at the outer scope to query the next plugin, otherwise we just retry the plugin we got an error on (potentially infinitely if it's an invalid request like an unsupported plugin). --- command/volume_status_csi.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/volume_status_csi.go b/command/volume_status_csi.go index 78502c6c1..3026fa50f 100644 --- a/command/volume_status_csi.go +++ b/command/volume_status_csi.go @@ -96,6 +96,7 @@ func (c *VolumeStatusCommand) listVolumes(client *api.Client) int { var code int q := &api.QueryOptions{PerPage: 30} // TODO: tune page size +NEXT_PLUGIN: for _, plugin := range plugins { if !plugin.ControllerRequired || plugin.ControllersHealthy < 1 { continue // only controller plugins can support this query @@ -109,7 +110,7 @@ func (c *VolumeStatusCommand) listVolumes(client *api.Client) int { // query, so report and set the error code but move on to the // next plugin code = 1 - continue + continue NEXT_PLUGIN } rows := []string{} if len(externalList.Volumes) > 0 {