mirror of https://github.com/databricks/cli.git
Update run_as tests for dashboards
This commit is contained in:
parent
5fb35e358f
commit
1b51c0cf0e
|
@ -110,6 +110,16 @@ func validateRunAs(b *bundle.Bundle) diag.Diagnostics {
|
|||
))
|
||||
}
|
||||
|
||||
// Dashboards do not support run_as in the API.
|
||||
if len(b.Config.Resources.Dashboards) > 0 {
|
||||
diags = diags.Extend(reportRunAsNotSupported(
|
||||
"dashboards",
|
||||
b.Config.GetLocation("resources.dashboards"),
|
||||
b.Config.Workspace.CurrentUser.UserName,
|
||||
identity,
|
||||
))
|
||||
}
|
||||
|
||||
return diags
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ func allResourceTypes(t *testing.T) []string {
|
|||
// also update this check when adding a new resource
|
||||
require.Equal(t, []string{
|
||||
"clusters",
|
||||
"dashboards",
|
||||
"experiments",
|
||||
"jobs",
|
||||
"model_serving_endpoints",
|
||||
|
@ -188,6 +189,7 @@ func TestRunAsErrorForUnsupportedResources(t *testing.T) {
|
|||
Config: *r,
|
||||
}
|
||||
diags := bundle.Apply(context.Background(), b, SetRunAs())
|
||||
require.Error(t, diags.Error())
|
||||
assert.Contains(t, diags.Error().Error(), "do not support a setting a run_as user that is different from the owner.\n"+
|
||||
"Current identity: alice. Run as identity: bob.\n"+
|
||||
"See https://docs.databricks.com/dev-tools/bundles/run-as.html to learn more about the run_as property.", rt)
|
||||
|
|
Loading…
Reference in New Issue