-
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(onboarding): don't ignore failures to set initial password #20317
Conversation
b7473ea
to
4b2f68c
Compare
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 really like to see this level of error handling. Nice work!
@@ -98,7 +107,18 @@ func (s *OnboardService) onboardUser(ctx context.Context, req *influxdb.Onboardi | |||
|
|||
// create users password | |||
if req.Password != "" { | |||
s.service.SetPassword(ctx, user.ID, req.Password) | |||
if err := s.service.SetPassword(ctx, user.ID, req.Password); err != 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.
This looks like the best you can do in cascading errors. Nice that you return the original error here, not the cleanup error. +1
4b2f68c
to
ff16703
Compare
Fixes #20088
This was the most obvious problem with the onboarding path's handling of passwords. There's also a lot of duplication in the CLI with slight differences between the onboarding paths for interactive vs. noninteractive runs and the
influx setup
vs.influxd upgrade
runs, but I'm leaving that refactor for a follow-up PR.