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: improve plugin error messages and volume validation #7984

Merged
merged 1 commit into from
May 18, 2020

Conversation

tgross
Copy link
Member

@tgross tgross commented May 15, 2020

Fixes #7424

Some CSI plugins don't return much for errors over the gRPC socket above and beyond the bare minimum error codes. This changeset improves the operator experience by unpacking the error codes when available and wrapping the error with some user-friendly direction.

Improving these errors also revealed a bad comparison with require.Error when require.EqualError should be used in the test code for plugin errors. This defect in turn was hiding a bug in volume validation where we're being overly permissive in allowing mount flags, which is now fixed.

cc @angrycub as a heads up

@tgross tgross added this to the 0.11.3 milestone May 15, 2020
@tgross tgross requested review from langmartin and drewbailey May 15, 2020 19:45
@tgross
Copy link
Member Author

tgross commented May 15, 2020

I just did a quick search over the rest of the code base and it looks like this is the only test file with the require.Error defect.

plugins/csi/client.go Outdated Show resolved Hide resolved
plugins/csi/client.go Outdated Show resolved Hide resolved
plugins/csi/client.go Outdated Show resolved Hide resolved
Some CSI plugins don't return much for errors over the gRPC socket
above and beyond the bare minimum error codes. This changeset improves
the operator experience by unpacking the error codes when available
and wrapping the error with some user-friendly direction.

Improving these errors also revealed a bad comparison with
`require.Error` when `require.EqualError` should be used in the test
code for plugin errors. This defect in turn was hiding a bug in volume
validation where we're being overly permissive in allowing mount
flags, which is now fixed.
@tgross tgross force-pushed the csi_better_errors branch from 8b23096 to 1a6b5ab Compare May 15, 2020 19:50
Copy link
Contributor

@langmartin langmartin left a comment

Choose a reason for hiding this comment

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

Looks good, this will be super useful.

@@ -469,7 +505,7 @@ func (c *client) NodeStageVolume(ctx context.Context, volumeID string, publishCo
}

// These errors should not be returned during production use but exist as aids
// during Nomad Development
// during Nomad development
Copy link
Contributor

Choose a reason for hiding this comment

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

def seem less ominous/sarcastic now 😁

@tgross tgross merged commit 64c6a8d into master May 18, 2020
@tgross tgross deleted the csi_better_errors branch May 18, 2020 12:23
tgross added a commit that referenced this pull request May 27, 2020
Some CSI plugins don't return much for errors over the gRPC socket
above and beyond the bare minimum error codes. This changeset improves
the operator experience by unpacking the error codes when available
and wrapping the error with some user-friendly direction.

Improving these errors also revealed a bad comparison with
`require.Error` when `require.EqualError` should be used in the test
code for plugin errors. This defect in turn was hiding a bug in volume
validation where we're being overly permissive in allowing mount
flags, which is now fixed.
@tgross
Copy link
Member Author

tgross commented May 27, 2020

Cherry-picked to 0.11.3 branch as b904bf4

@github-actions
Copy link

github-actions bot commented Jan 4, 2023

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 Jan 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSI: internal plugin errors aren't exposed to operator
3 participants