-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 auth for CLI #2265
Fix auth for CLI #2265
Conversation
As a side note, there is no real way to write a test for this as both the |
@otoolep previously, we had just However, when we know we want a "Test" config (AKA Demo Mode), then we call that specifically. This was already happening behind the scenes before I made this change, but now you see it where it happens, which I like a lot more. For reference, here is what we add when you ask for a test config:
|
OK, thanks @corylanou, makes sense. This is a different change, but |
Otherwise change looks fine. |
Agree on the naming. it was between |
f94a3e5
to
33f976a
Compare
lgtm |
// Remove it to clean up past failed panics | ||
// Defer it to clean up for successful tests | ||
path := tempfile() | ||
os.Remove(path) |
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.
tempfile()
already removes the path, and cleaning up past runs is not possible, since the path changes each time.
Looks good, just some minor feedback. Unfortunately I don't think we can clean up directories if a test panics, so that part of the change might be optimistic. |
The auth for CLI was not setting credentials properly in the client package.
This PR does a couple things:
cmd/influxd
package to be more consistent. This was a side affect of trying to trace down where configs were parsed and was just to difficult to leave the current code.SetAuth
to the client library to allow for resetting credentials.Fixes #2239