mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-12 14:37:08 +08:00
bumpo compose-go to v2.1.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
10
vendor/github.com/compose-spec/compose-go/v2/loader/reset.go
generated
vendored
10
vendor/github.com/compose-spec/compose-go/v2/loader/reset.go
generated
vendored
@ -19,6 +19,7 @@ package loader
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/compose-spec/compose-go/v2/tree"
|
||||
"gopkg.in/yaml.v3"
|
||||
@ -40,6 +41,15 @@ func (p *ResetProcessor) UnmarshalYAML(value *yaml.Node) error {
|
||||
|
||||
// resolveReset detects `!reset` tag being set on yaml nodes and record position in the yaml tree
|
||||
func (p *ResetProcessor) resolveReset(node *yaml.Node, path tree.Path) (*yaml.Node, error) {
|
||||
// If the path contains "<<", removing the "<<" element and merging the path
|
||||
if strings.Contains(path.String(), ".<<") {
|
||||
path = tree.NewPath(strings.Replace(path.String(), ".<<", "", 1))
|
||||
}
|
||||
// If the node is an alias, We need to process the alias field in order to consider the !override and !reset tags
|
||||
if node.Kind == yaml.AliasNode {
|
||||
return p.resolveReset(node.Alias, path)
|
||||
}
|
||||
|
||||
if node.Tag == "!reset" {
|
||||
p.paths = append(p.paths, path)
|
||||
return nil, nil
|
||||
|
Reference in New Issue
Block a user