Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSI: fix prefix queries for plugin status #12194

Merged
merged 1 commit into from
Mar 4, 2022
Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented Mar 4, 2022

The CSIPlugin.List RPC was intended to accept a prefix to filter the
list of plugins being listed. This was being accidentally being done
in the state store instead, which contributed to incorrect filtering
behavior for plugins in the volume plugin status command.

Move the prefix matching into the RPC so that it calls the
prefix-matching method in the state store if we're looking for a
prefix.

Update the plugin status command to accept a prefix for the plugin
ID argument so that it matches the expected behavior of other commands.


I pulled this out of #12193 because this will need to be backported, whereas not everything in that PR should be.

@@ -1100,6 +1100,7 @@ func TestCSIVolumeEndpoint_ListExternal(t *testing.T) {
// List external volumes; note that none of these exist in the state store

req := &structs.CSIVolumeExternalListRequest{
PluginID: "minnie",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: these tests should have failed before and weren't because this bug masked the test bug.

The `CSIPlugin.List` RPC was intended to accept a prefix to filter the
list of plugins being listed. This was being accidentally being done
in the state store instead, which contributed to incorrect filtering
behavior for plugins in the `volume plugin status` command.

Move the prefix matching into the RPC so that it calls the
prefix-matching method in the state store if we're looking for a
prefix.

Update the `plugin status command` to accept a prefix for the plugin
ID argument so that it matches the expected behavior of other commands.
@tgross tgross force-pushed the csi-plugin-list-filtering branch from 4176d06 to 892397e Compare March 4, 2022 21:00
@vercel vercel bot temporarily deployed to Preview – nomad March 4, 2022 21:00 Inactive
@tgross tgross changed the title CSI: fix prefix queries for plugin list RPC CSI: fix prefix queries for plugin status Mar 4, 2022
Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.1.x backport to 1.1.x release line backport/1.2.x backport to 1.1.x release line theme/storage type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants