Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acceptance/bundle/variables/empty/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cleaned up during bundle destroy.
at bundle.name
in databricks.yml:7:9

Error: no value assigned to required variable a. Assignment can be done using "--var", by setting the BUNDLE_VAR_a environment variable, or in .databricks/bundle/<target>/variable-overrides.json file
Error: no value assigned to required variable a. Variables are usually assigned in databricks.yml, and they can be overridden using "--var", the BUNDLE_VAR_a environment variable, or .databricks/bundle/<target>/variable-overrides.json

Name: empty${var.a}
Target: default
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/variables/env_overrides/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"prod-a env-var-b"

>>> errcode [CLI] bundle validate -t env-missing-a-required-variable-assignment
Error: no value assigned to required variable b. Assignment can be done using "--var", by setting the BUNDLE_VAR_b environment variable, or in .databricks/bundle/<target>/variable-overrides.json file
Error: no value assigned to required variable b. Variables are usually assigned in databricks.yml, and they can be overridden using "--var", the BUNDLE_VAR_b environment variable, or .databricks/bundle/<target>/variable-overrides.json

Name: test bundle
Target: env-missing-a-required-variable-assignment
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/variables/file-defaults/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Exit code: 1

=== variable is required but it's not provided in the file
>>> errcode [CLI] bundle validate -o json --target without_defaults
Error: no value assigned to required variable cluster. Assignment can be done using "--var", by setting the BUNDLE_VAR_cluster environment variable, or in .databricks/bundle/<target>/variable-overrides.json file
Error: no value assigned to required variable cluster. Variables are usually assigned in databricks.yml, and they can be overridden using "--var", the BUNDLE_VAR_cluster environment variable, or .databricks/bundle/<target>/variable-overrides.json


Exit code: 1
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/variables/vanilla/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"abc def"

>>> errcode [CLI] bundle validate
Error: no value assigned to required variable b. Assignment can be done using "--var", by setting the BUNDLE_VAR_b environment variable, or in .databricks/bundle/<target>/variable-overrides.json file
Error: no value assigned to required variable b. Variables are usually assigned in databricks.yml, and they can be overridden using "--var", the BUNDLE_VAR_b environment variable, or .databricks/bundle/<target>/variable-overrides.json

Name: foobar
Target: default
Expand Down
2 changes: 1 addition & 1 deletion bundle/config/mutator/set_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func setVariable(ctx context.Context, v dyn.Value, variable *variable.Variable,
}

// We should have had a value to set for the variable at this point.
return dyn.InvalidValue, fmt.Errorf(`no value assigned to required variable %s. Assignment can be done using "--var", by setting the %s environment variable, or in %s file`, name, bundleVarPrefix+name, getDefaultVariableFilePath("<target>"))
return dyn.InvalidValue, fmt.Errorf(`no value assigned to required variable %s. Variables are usually assigned in databricks.yml, and they can be overridden using "--var", the %s environment variable, or %s`, name, bundleVarPrefix+name, getDefaultVariableFilePath("<target>"))
}

func readVariablesFromFile(b *bundle.Bundle) (dyn.Value, diag.Diagnostics) {
Expand Down
2 changes: 1 addition & 1 deletion bundle/config/mutator/set_variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestSetVariablesErrorsIfAValueCouldNotBeResolved(t *testing.T) {
require.NoError(t, err)

_, err = setVariable(context.Background(), v, &variable, "foo", dyn.NilValue)
assert.ErrorContains(t, err, "no value assigned to required variable foo. Assignment can be done using \"--var\", by setting the BUNDLE_VAR_foo environment variable, or in .databricks/bundle/<target>/variable-overrides.json file")
assert.ErrorContains(t, err, "no value assigned to required variable foo. Variables are usually assigned in databricks.yml, and they can be overridden using \"--var\", the BUNDLE_VAR_foo environment variable, or .databricks/bundle/<target>/variable-overrides.json")
}

func TestSetVariablesMutator(t *testing.T) {
Expand Down