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).
This commit is contained in:
Tim Gross 2021-04-07 09:48:40 -04:00 committed by Tim Gross
parent 70f5363a89
commit 2e8dc1dee2

View file

@ -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 {