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 databricks_user creation with force on account #1577

Merged
merged 2 commits into from
Sep 2, 2022

Conversation

nkvuong
Copy link
Contributor

@nkvuong nkvuong commented Sep 1, 2022

Backend API changes error messages, updating code to match

Closes #1549

force := fmt.Sprintf("User with username %s already exists.", userName)
force := fmt.Sprintf("User with email %s already exists in this account", userName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it continue to work with the workspace level identities?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are correct - updated the correct error message

fmt.Errorf("User with username me@example.com already exists."),
fmt.Errorf("User with email me@example.com already exists in this account"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this format string into a constant, or create a function that will accept email & return string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored the error messages into a function

@codecov-commenter
Copy link

Codecov Report

Merging #1577 (df45a9a) into master (a723577) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1577   +/-   ##
=======================================
  Coverage   90.15%   90.16%           
=======================================
  Files         132      132           
  Lines       10629    10631    +2     
=======================================
+ Hits         9583     9585    +2     
  Misses        667      667           
  Partials      379      379           
Impacted Files Coverage Δ
scim/resource_user.go 94.28% <100.00%> (+0.16%) ⬆️

@nkvuong nkvuong changed the title Fix databricks_user creation with force on account Fix databricks_user creation with force on account Sep 2, 2022
@nfx nfx enabled auto-merge (squash) September 2, 2022 12:08
@nfx nfx merged commit 479745e into master Sep 2, 2022
@nkvuong nkvuong deleted the fix/force_user_creation branch September 2, 2022 14:06
@nfx nfx mentioned this pull request Sep 12, 2022
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
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.

[ISSUE] databricks_user with force on account does not always work
4 participants