Skip to content

Commit 6ca57a7

Browse files
Add docs URL for run_as in error message (#1381)
1 parent e008c2b commit 6ca57a7

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

bundle/config/mutator/run_as.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ type errUnsupportedResourceTypeForRunAs struct {
3535
runAsUser string
3636
}
3737

38-
// TODO(6 March 2024): Link the docs page describing run_as semantics in the error below
39-
// once the page is ready.
4038
func (e errUnsupportedResourceTypeForRunAs) Error() string {
41-
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)
39+
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)
4240
}
4341

4442
type errBothSpAndUserSpecified struct {

bundle/tests/run_as_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestRunAsErrorForPipelines(t *testing.T) {
113113
err := diags.Error()
114114

115115
configPath := filepath.FromSlash("run_as/not_allowed/pipelines/databricks.yml")
116-
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))
116+
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))
117117
}
118118

119119
func TestRunAsNoErrorForPipelines(t *testing.T) {
@@ -152,7 +152,7 @@ func TestRunAsErrorForModelServing(t *testing.T) {
152152
err := diags.Error()
153153

154154
configPath := filepath.FromSlash("run_as/not_allowed/model_serving/databricks.yml")
155-
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))
155+
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))
156156
}
157157

158158
func TestRunAsNoErrorForModelServingEndpoints(t *testing.T) {

0 commit comments

Comments
 (0)