mirror of https://github.com/databricks/cli.git
address comments
This commit is contained in:
parent
f26027ab1c
commit
9689a79f22
|
@ -139,7 +139,7 @@ func TestRootMergeTargetOverridesWithVariables(t *testing.T) {
|
|||
},
|
||||
Targets: map[string]*Target{
|
||||
"development": {
|
||||
Variables: map[string]*TargetVariable{
|
||||
Variables: map[string]*variable.TargetVariable{
|
||||
"foo": {
|
||||
Default: "bar",
|
||||
Description: "wrong",
|
||||
|
|
|
@ -8,11 +8,6 @@ import (
|
|||
|
||||
type Mode string
|
||||
|
||||
// We alias it here to override the JSON schema associated with a variable value
|
||||
// in a target override. This is because we allow for directly specifying the value
|
||||
// in addition to the variable.Variable struct format in a target override.
|
||||
type TargetVariable variable.Variable
|
||||
|
||||
// Target defines overrides for a single target.
|
||||
// This structure is recursively merged into the root configuration.
|
||||
type Target struct {
|
||||
|
@ -62,7 +57,7 @@ type Target struct {
|
|||
// variables:
|
||||
// foo:
|
||||
// lookup: "resource_name"
|
||||
Variables map[string]*TargetVariable `json:"variables,omitempty"`
|
||||
Variables map[string]*variable.TargetVariable `json:"variables,omitempty"`
|
||||
|
||||
Git Git `json:"git,omitempty"`
|
||||
|
||||
|
|
|
@ -16,6 +16,11 @@ const (
|
|||
VariableTypeComplex VariableType = "complex"
|
||||
)
|
||||
|
||||
// We alias it here to override the JSON schema associated with a variable value
|
||||
// in a target override. This is because we allow for directly specifying the value
|
||||
// in addition to the variable.Variable struct format in a target override.
|
||||
type TargetVariable Variable
|
||||
|
||||
// An input variable for the bundle config
|
||||
type Variable struct {
|
||||
// A type of the variable. This is used to validate the value of the variable
|
||||
|
|
|
@ -23,7 +23,7 @@ func addInterpolationPatterns(typ reflect.Type, s jsonschema.Schema) jsonschema.
|
|||
|
||||
// The variables block in a target override allows for directly specifying
|
||||
// the value if it is a primitive type.
|
||||
if typ == reflect.TypeOf(config.TargetVariable{}) {
|
||||
if typ == reflect.TypeOf(variable.TargetVariable{}) {
|
||||
return jsonschema.Schema{
|
||||
AnyOf: []jsonschema.Schema{s,
|
||||
{Type: jsonschema.StringType},
|
||||
|
|
Loading…
Reference in New Issue