Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Sep 10, 2024
1 parent f26027a commit 9689a79
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bundle/config/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 1 addition & 6 deletions bundle/config/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"`

Expand Down
5 changes: 5 additions & 0 deletions bundle/config/variable/variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bundle/internal/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 9689a79

Please sign in to comment.