mirror of https://github.com/databricks/cli.git
Change variables block to map of any in `Targets` struct
This commit is contained in:
parent
e1a8e03cea
commit
48af9d1c57
|
@ -2,7 +2,6 @@ package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/databricks/cli/bundle/config/resources"
|
"github.com/databricks/cli/bundle/config/resources"
|
||||||
"github.com/databricks/cli/bundle/config/variable"
|
|
||||||
"github.com/databricks/databricks-sdk-go/service/jobs"
|
"github.com/databricks/databricks-sdk-go/service/jobs"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -38,7 +37,26 @@ type Target struct {
|
||||||
// Override default values or lookup name for defined variables
|
// Override default values or lookup name for defined variables
|
||||||
// Does not permit defining new variables or redefining existing ones
|
// Does not permit defining new variables or redefining existing ones
|
||||||
// in the scope of an target
|
// in the scope of an target
|
||||||
Variables map[string]*variable.Variable `json:"variables,omitempty"`
|
//
|
||||||
|
// There are two valid ways to define a variable override in a target:
|
||||||
|
// 1. Direct value override. We normalize this to the variable.Variable
|
||||||
|
// struct format when loading the configuration YAML:
|
||||||
|
//
|
||||||
|
// variables:
|
||||||
|
// foo: "value"
|
||||||
|
//
|
||||||
|
// 2. Override matching the variable.Variable struct.
|
||||||
|
//
|
||||||
|
// variables:
|
||||||
|
// foo:
|
||||||
|
// default: "value"
|
||||||
|
//
|
||||||
|
// OR
|
||||||
|
//
|
||||||
|
// variables:
|
||||||
|
// foo:
|
||||||
|
// lookup: "resource_name"
|
||||||
|
Variables map[string]any `json:"variables,omitempty"`
|
||||||
|
|
||||||
Git Git `json:"git,omitempty"`
|
Git Git `json:"git,omitempty"`
|
||||||
|
|
||||||
|
|
|
@ -995,7 +995,7 @@
|
||||||
"$ref": "#/$defs/github.com/databricks/cli/bundle/config.Sync"
|
"$ref": "#/$defs/github.com/databricks/cli/bundle/config.Sync"
|
||||||
},
|
},
|
||||||
"variables": {
|
"variables": {
|
||||||
"$ref": "#/$defs/map/github.com/databricks/cli/bundle/config/variable.Variable"
|
"$ref": "#/$defs/map/interface"
|
||||||
},
|
},
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"$ref": "#/$defs/github.com/databricks/cli/bundle/config.Workspace"
|
"$ref": "#/$defs/github.com/databricks/cli/bundle/config.Workspace"
|
||||||
|
@ -5054,6 +5054,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"interface": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"$ref": "#/$defs/interface"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "\\$\\{(var(\\.[a-zA-Z]+([-_]?[a-zA-Z0-9]+)*(\\[[0-9]+\\])*)*(\\[[0-9]+\\])*)\\}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"string": {
|
"string": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue