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

Added READ_VOLUME and WRITE_VOLUME to schema/catalog level grants #2529

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Added READ_VOLUME and WRITE_VOLUME to schema/catalog level grants #2529

merged 3 commits into from
Aug 1, 2023

Conversation

jl178
Copy link
Contributor

@jl178 jl178 commented Jul 28, 2023

Changes

According to the Databricks documentation & the docs in this repo, you should be able to have READ_VOLUME and WRITE_VOLUME at the schema level. However, this currently fails here.

Example resource block:

resource "databricks_grants" "volumes_grant" {
  schema = databricks_schema.volumes.id
  grant {
    principal  = databricks_group.group.display_name
    privileges = ["READ_VOLUME", "WRITE_VOLUME"]
  }
}

Error:

Error: READ_VOLUME is not allowed on schema

It seems like this was missed during this PR, even though the docs were updated correctly.

This is my first contribution, so please let me know if I am missing something! Thanks!

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

@jl178 jl178 requested review from a team as code owners July 28, 2023 19:19
Copy link
Contributor

@nkvuong nkvuong left a comment

Choose a reason for hiding this comment

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

Could you also add this to catalog level grants, as it is also supported via inheritance

@jl178 jl178 requested a review from nkvuong July 28, 2023 19:30
@jl178 jl178 changed the title Added READ_VOLUME and WRITE_VOLUME to schema level grants Added READ_VOLUME and WRITE_VOLUME to schema/catalog level grants Jul 28, 2023
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov-commenter
Copy link

Codecov Report

Merging #2529 (aa37f85) into master (6b7220a) will not change coverage.
Report is 1 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2529   +/-   ##
=======================================
  Coverage   88.20%   88.20%           
=======================================
  Files         145      145           
  Lines       11982    11982           
=======================================
  Hits        10569    10569           
  Misses        930      930           
  Partials      483      483           
Files Changed Coverage Δ
catalog/resource_grants.go 96.22% <ø> (ø)

@jl178 jl178 mentioned this pull request Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants