-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
No vault addr dont panic #85
No vault addr dont panic #85
Conversation
@@ -0,0 +1,23 @@ | |||
package vault |
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.
can you throw these into client_test.go
?
9923ef9
to
3e775e9
Compare
Removed |
@@ -81,9 +89,13 @@ func (c *Client) Do(req *http.Request) (*http.Response, error) { | |||
|
|||
// Login - log in to Vault with the discovered auth backend and save the token | |||
func (c *Client) Login() error { | |||
if c.Auth == nil { |
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.
Can you move this check inside getAuthStrategy()
?
b826f5e
to
456eebd
Compare
Moved |
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.
LGTM!
A second attempt at a fix for #84. PTAL @hairyhenderson
This time, rather than twisting gomplate into a pretzel trying to propagate errors, a small testing hack is being made to allow
log.Fatal
to be overwritten inside tests to inject a mock/spy that doesn't cause the process to exit.Added unit tests and also checked on the command-line that gomplate doesn't panic when some/all of the
VAULT_*
environment variables are missing: