Skip to content
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

Merged
merged 3 commits into from
Dec 16, 2020

Conversation

danxmoran
Copy link
Contributor

@danxmoran danxmoran commented Dec 11, 2020

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.

@danxmoran danxmoran force-pushed the dm-no-ignore-password-err-20088 branch from b7473ea to 4b2f68c Compare December 15, 2020 23:27
Copy link
Contributor

@davidby-influx davidby-influx left a 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 {
Copy link
Contributor

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

@danxmoran danxmoran force-pushed the dm-no-ignore-password-err-20088 branch from 4b2f68c to ff16703 Compare December 16, 2020 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Onboarding API ignores errors when trying to set user password
3 participants