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 edge cases for databricks_permissions resource #2158

Merged
merged 2 commits into from
Mar 31, 2023

Conversation

nkvuong
Copy link
Contributor

@nkvuong nkvuong commented Mar 24, 2023

Changes

Fix edge cases when setting permissions for root directory and password/token usage

Closes #2087
closes #2134

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@nkvuong nkvuong marked this pull request as ready for review March 24, 2023 17:31
@nkvuong
Copy link
Contributor Author

nkvuong commented Mar 24, 2023

acceptance tests passed on all 3 clouds

if strings.ToLower(v) == "admins" {
return diag.Diagnostics{
{
Summary: "It is not possible to restrict any permissions from `admins`.",
Copy link
Contributor

Choose a reason for hiding this comment

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

why? it'll keep popping up in the diff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved this logic down to Create (same place where we validate decreasing permission for current users), as it is possible to set permission on authorization/passwords for admins #2087

@codecov-commenter
Copy link

Codecov Report

Merging #2158 (b8ed0a5) into master (314c1ad) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2158      +/-   ##
==========================================
- Coverage   88.74%   88.74%   -0.01%     
==========================================
  Files         137      137              
  Lines       11217    11208       -9     
==========================================
- Hits         9955     9947       -8     
+ Misses        853      852       -1     
  Partials      409      409              
Impacted Files Coverage Δ
permissions/resource_permissions.go 88.84% <100.00%> (-0.01%) ⬇️

@nfx nfx merged commit f54d336 into master Mar 31, 2023
@nfx nfx deleted the fix/permissions_edge_case branch March 31, 2023 10:58
@nfx nfx mentioned this pull request Mar 31, 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
3 participants