-
Notifications
You must be signed in to change notification settings - Fork 540
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
Fix "panic: interface conversion" #250
Conversation
The max_connection_lifetime parameter in the Vault API is configured according to number + s, e.g. "100s". The code didn't strip the trailing s from the number prior to casting. This problem was only noticable when doing an update.
@ashemedai thank you for working on this! Is this a dupe of #117? When I run the database connection tests, for me they pass right now. |
@tyrannosaurus-becks I think it is. However, the issue still remains it's easily reproducible whenever EDIT: This happens with Version 1.3.1 of the provider, we didn't build from master. |
@tyrannosaurus-becks The difference with the #117 is that that PR's tests are comparing what's expected to Duration type results, whereas they should remain integers, as that is what the schema definition defines. |
I'm seeing this panic on master as well:
Applying this patch fixed my crash. It'd be really nice to get this into a released version. |
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.
Ah, I see. Thank you @ashemedai and everyone!
Fix "panic: interface conversion"
Fix "panic: interface conversion"
The
max_connection_lifetime
parameter is defined in the schema as an TypeInt, however, the Vault API expects it as a string (time.Duration) representation.Parse the string as a time.Duration and use the representation in seconds.
Resolves: #114 #117 #152 #154