-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow for response errors to be passed back from a plugin #3412
Conversation
Should the same be applied for |
^ that -- other than that looks good. Although keep in mind that this may need to be applied to the persona lookahead once that is on this side of things, so you may want to do that as a followup on the other side so it doesn't get lost. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, you're right. Since HandleExistenceCheck
doesn't return reply.Response
, return false, false, reply.Error
should be fine since those would be reply.CheckFound
and reply.Exists
zero values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are showing that it's returning <nil>
string instead of a nil object.
@@ -117,10 +117,9 @@ func (b *backendPluginClient) HandleRequest(req *logical.Request) (*logical.Resp | |||
if reply.Error.Error() == logical.ErrUnsupportedOperation.Error() { | |||
return nil, logical.ErrUnsupportedOperation | |||
} | |||
return nil, reply.Error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might need to do return reply.Response, reply.Error
here, and keep the other line to explicitly return nil
@calvn updated, and I tested with the the kubernetes plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, LGTM!
Plugins were previously swallowing the response errors when an error was also returned: