feat: some stuff?
All checks were successful
Build and Push Server / build-and-push (push) Successful in 4m19s
All checks were successful
Build and Push Server / build-and-push (push) Successful in 4m19s
This commit is contained in:
@@ -16,7 +16,7 @@ func Yaml(input string, block template.Block) (value any, error error) {
|
||||
return nil, fmt.Errorf("failed to parse yaml '%q': %w", input, err)
|
||||
}
|
||||
|
||||
var out any
|
||||
var out any // Keep out as any
|
||||
for _, f := range block.Fields {
|
||||
|
||||
if f.Path == "@schema" {
|
||||
@@ -25,7 +25,14 @@ func Yaml(input string, block template.Block) (value any, error error) {
|
||||
|
||||
if f.CodecType == template.CodecConst {
|
||||
if f.Value != nil {
|
||||
out = utils.SetPathValue(f.Path, f.Value, out)
|
||||
// Only set const value if 'out' is a map and the path doesn't exist
|
||||
if outMap, ok := out.(map[string]any); ok {
|
||||
if _, exists := renderUtils.GetValueFromPath(outMap, f.Path); !exists {
|
||||
out = utils.SetPathValue(f.Path, f.Value, out)
|
||||
}
|
||||
} else if out == nil { // If out is nil, it's the first value, so set it
|
||||
out = utils.SetPathValue(f.Path, f.Value, out)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if value, ok := res[f.Path]; ok {
|
||||
|
||||
Reference in New Issue
Block a user