This commit is contained in:
Lennart Kats 2024-07-31 10:14:48 +02:00
parent 3ba3c17937
commit 9981f07cc3
No known key found for this signature in database
GPG Key ID: 1EB8B57673197023
3 changed files with 3 additions and 4 deletions

View File

@ -109,7 +109,7 @@ func isGroupOfCurrentUser(b *bundle.Bundle, groupName string) bool {
} }
func ReportPermissionDenied(ctx context.Context, b *bundle.Bundle, path string) diag.Diagnostics { func ReportPermissionDenied(ctx context.Context, b *bundle.Bundle, path string) diag.Diagnostics {
log.Errorf(ctx, "Failed to update %v", path) log.Errorf(ctx, "Failed to update, encountated permission denied error: %v", path)
user := b.Config.Workspace.CurrentUser.DisplayName user := b.Config.Workspace.CurrentUser.DisplayName
canManageBundle, assistance := analyzeBundlePermissions(b) canManageBundle, assistance := analyzeBundlePermissions(b)

View File

@ -21,7 +21,7 @@ func TryExtendTerraformPermissionError(ctx context.Context, b *bundle.Bundle, er
if !strings.Contains(err.Error(), "cannot update permissions") && if !strings.Contains(err.Error(), "cannot update permissions") &&
!strings.Contains(err.Error(), "permissions on pipeline") && !strings.Contains(err.Error(), "permissions on pipeline") &&
!strings.Contains(err.Error(), "cannot read permissions") && !strings.Contains(err.Error(), "cannot read permissions") &&
!strings.Contains(err.Error(), "annot set run_as to user") { !strings.Contains(err.Error(), "cannot set run_as to user") {
return nil return nil
} }

View File

@ -113,10 +113,9 @@ func TestRunAsErrorForPipelines(t *testing.T) {
diags := bundle.Apply(ctx, b, mutator.SetRunAs()) diags := bundle.Apply(ctx, b, mutator.SetRunAs())
err := diags.Error() err := diags.Error()
configPath := filepath.FromSlash("run_as/not_allowed/pipelines/databricks.yml")
assert.ErrorContains(t, err, "pipelines do not support a setting a run_as user that is different from the owner.\n"+ assert.ErrorContains(t, err, "pipelines do not support a setting a run_as user that is different from the owner.\n"+
"Current identity: jane@doe.com. Run as identity: my_service_principal.\n"+ "Current identity: jane@doe.com. Run as identity: my_service_principal.\n"+
"See https://docs", configPath) "See https://docs")
} }
func TestRunAsNoErrorForPipelines(t *testing.T) { func TestRunAsNoErrorForPipelines(t *testing.T) {