Skip to content

Commit

Permalink
Change variables block to map of any in Targets struct
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Sep 4, 2024
1 parent 42da1c9 commit 6c488ba
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
22 changes: 20 additions & 2 deletions bundle/config/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"github.com/databricks/cli/bundle/config/resources"
"github.com/databricks/cli/bundle/config/variable"
"github.com/databricks/databricks-sdk-go/service/jobs"
)

Expand Down Expand Up @@ -38,7 +37,26 @@ type Target struct {
// Override default values or lookup name for defined variables
// Does not permit defining new variables or redefining existing ones
// 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"`

Expand Down
16 changes: 15 additions & 1 deletion bundle/generated/jsonschema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c488ba

Please sign in to comment.