[Fix] Cluster permission to use ClusterId not JobId. #1818
Closed
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Playing around with the possibility to deploy shared clusters, which was released in v0.229.0 (#1698) it was observed that shared clusters cannot be exposed to other users/service principals/groups by setting appropriate permissions. Debugging this, we found that the produced terraform databricks_permission resource configuration provides the object id through the job_id parameter where the cluster_id parameter would be required, see terraform databricks cluster permissions documentation.
Changing from JobId to ClusterId for the permissions object in bundle/deploy/terraform/tfdyn/convert_cluster.go fixes the observed problem.
Note: It is unclear if further changes are required for consistency. bunde/permissions/mutator.go includes structures which do not include clusters at all. Since no issue was observed for the test below, it was concluded that this part of the code is most likely only relevant for top-level permission assignments.
Tests
Manual test by deploying a shared cluster using a service principle and making it accessible to another user by explicitly setting permissions to one group which the user belongs to. Example: