address comments

This commit is contained in:
Shreyas Goenka 2024-09-04 17:42:02 +02:00
parent f26027ab1c
commit 9689a79f22
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
4 changed files with 8 additions and 8 deletions

View File

@ -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",

View File

@ -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"`

View File

@ -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

View File

@ -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},