mirror of https://github.com/databricks/cli.git
Add docs URL for `run_as` in error message (#1381)
This commit is contained in:
parent
e008c2bd8c
commit
6ca57a7e68
|
@ -35,10 +35,8 @@ type errUnsupportedResourceTypeForRunAs struct {
|
||||||
runAsUser string
|
runAsUser string
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(6 March 2024): Link the docs page describing run_as semantics in the error below
|
|
||||||
// once the page is ready.
|
|
||||||
func (e errUnsupportedResourceTypeForRunAs) Error() string {
|
func (e errUnsupportedResourceTypeForRunAs) Error() string {
|
||||||
return fmt.Sprintf("%s are not supported when the current deployment user is different from the bundle's run_as identity. Please deploy as the run_as identity. Location of the unsupported resource: %s. Current identity: %s. Run as identity: %s", e.resourceType, e.resourceLocation, e.currentUser, e.runAsUser)
|
return fmt.Sprintf("%s are not supported when the current deployment user is different from the bundle's run_as identity. Please deploy as the run_as identity. Please refer to the documentation at https://docs.databricks.com/dev-tools/bundles/run-as.html for more details. Location of the unsupported resource: %s. Current identity: %s. Run as identity: %s", e.resourceType, e.resourceLocation, e.currentUser, e.runAsUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
type errBothSpAndUserSpecified struct {
|
type errBothSpAndUserSpecified struct {
|
||||||
|
|
|
@ -113,7 +113,7 @@ func TestRunAsErrorForPipelines(t *testing.T) {
|
||||||
err := diags.Error()
|
err := diags.Error()
|
||||||
|
|
||||||
configPath := filepath.FromSlash("run_as/not_allowed/pipelines/databricks.yml")
|
configPath := filepath.FromSlash("run_as/not_allowed/pipelines/databricks.yml")
|
||||||
assert.EqualError(t, err, fmt.Sprintf("pipelines are not supported when the current deployment user is different from the bundle's run_as identity. Please deploy as the run_as identity. Location of the unsupported resource: %s:14:5. Current identity: jane@doe.com. Run as identity: my_service_principal", configPath))
|
assert.EqualError(t, err, fmt.Sprintf("pipelines are not supported when the current deployment user is different from the bundle's run_as identity. Please deploy as the run_as identity. Please refer to the documentation at https://docs.databricks.com/dev-tools/bundles/run-as.html for more details. Location of the unsupported resource: %s:14:5. Current identity: jane@doe.com. Run as identity: my_service_principal", configPath))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRunAsNoErrorForPipelines(t *testing.T) {
|
func TestRunAsNoErrorForPipelines(t *testing.T) {
|
||||||
|
@ -152,7 +152,7 @@ func TestRunAsErrorForModelServing(t *testing.T) {
|
||||||
err := diags.Error()
|
err := diags.Error()
|
||||||
|
|
||||||
configPath := filepath.FromSlash("run_as/not_allowed/model_serving/databricks.yml")
|
configPath := filepath.FromSlash("run_as/not_allowed/model_serving/databricks.yml")
|
||||||
assert.EqualError(t, err, fmt.Sprintf("model_serving_endpoints are not supported when the current deployment user is different from the bundle's run_as identity. Please deploy as the run_as identity. Location of the unsupported resource: %s:14:5. Current identity: jane@doe.com. Run as identity: my_service_principal", configPath))
|
assert.EqualError(t, err, fmt.Sprintf("model_serving_endpoints are not supported when the current deployment user is different from the bundle's run_as identity. Please deploy as the run_as identity. Please refer to the documentation at https://docs.databricks.com/dev-tools/bundles/run-as.html for more details. Location of the unsupported resource: %s:14:5. Current identity: jane@doe.com. Run as identity: my_service_principal", configPath))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRunAsNoErrorForModelServingEndpoints(t *testing.T) {
|
func TestRunAsNoErrorForModelServingEndpoints(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue