mirror of https://github.com/databricks/cli.git
Cleanup
This commit is contained in:
parent
3ba3c17937
commit
9981f07cc3
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue