mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-17 00:47:10 +08:00
bump compose-go to version v2.6.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
8
vendor/github.com/compose-spec/compose-go/v2/loader/loader.go
generated
vendored
8
vendor/github.com/compose-spec/compose-go/v2/loader/loader.go
generated
vendored
@ -26,6 +26,7 @@ import (
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@ -42,7 +43,6 @@ import (
|
||||
"github.com/compose-spec/compose-go/v2/validation"
|
||||
"github.com/go-viper/mapstructure/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/exp/slices"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
@ -337,7 +337,7 @@ func LoadModelWithContext(ctx context.Context, configDetails types.ConfigDetails
|
||||
// LoadModelWithContext reads a ConfigDetails and returns a fully loaded configuration as a yaml dictionary
|
||||
func loadModelWithContext(ctx context.Context, configDetails *types.ConfigDetails, opts *Options) (map[string]any, error) {
|
||||
if len(configDetails.ConfigFiles) < 1 {
|
||||
return nil, errors.New("No files specified")
|
||||
return nil, errors.New("no compose file specified")
|
||||
}
|
||||
|
||||
err := projectName(configDetails, opts)
|
||||
@ -432,7 +432,7 @@ func loadYamlFile(ctx context.Context,
|
||||
}
|
||||
cfg, ok := converted.(map[string]interface{})
|
||||
if !ok {
|
||||
return errors.New("Top-level object must be a mapping")
|
||||
return errors.New("top-level object must be a mapping")
|
||||
}
|
||||
|
||||
if opts.Interpolate != nil && !opts.SkipInterpolation {
|
||||
@ -877,7 +877,7 @@ func formatInvalidKeyError(keyPrefix string, key interface{}) error {
|
||||
} else {
|
||||
location = fmt.Sprintf("in %s", keyPrefix)
|
||||
}
|
||||
return fmt.Errorf("Non-string key %s: %#v", location, key)
|
||||
return fmt.Errorf("non-string key %s: %#v", location, key)
|
||||
}
|
||||
|
||||
// Windows path, c:\\my\\path\\shiny, need to be changed to be compatible with
|
||||
|
6
vendor/github.com/compose-spec/compose-go/v2/loader/reset.go
generated
vendored
6
vendor/github.com/compose-spec/compose-go/v2/loader/reset.go
generated
vendored
@ -67,6 +67,8 @@ func (p *ResetProcessor) resolveReset(node *yaml.Node, path tree.Path) (*yaml.No
|
||||
p.paths = append(p.paths, path)
|
||||
return node, nil
|
||||
}
|
||||
|
||||
keys := map[string]int{}
|
||||
switch node.Kind {
|
||||
case yaml.SequenceNode:
|
||||
var nodes []*yaml.Node
|
||||
@ -87,6 +89,10 @@ func (p *ResetProcessor) resolveReset(node *yaml.Node, path tree.Path) (*yaml.No
|
||||
for idx, v := range node.Content {
|
||||
if idx%2 == 0 {
|
||||
key = v.Value
|
||||
if line, seen := keys[key]; seen {
|
||||
return nil, fmt.Errorf("line %d: mapping key %#v already defined at line %d", v.Line, key, line)
|
||||
}
|
||||
keys[key] = v.Line
|
||||
} else {
|
||||
resolved, err := p.resolveReset(v, path.Next(key))
|
||||
if err != nil {
|
||||
|
2
vendor/github.com/compose-spec/compose-go/v2/loader/validate.go
generated
vendored
2
vendor/github.com/compose-spec/compose-go/v2/loader/validate.go
generated
vendored
@ -29,7 +29,7 @@ import (
|
||||
// checkConsistency validate a compose model is consistent
|
||||
func checkConsistency(project *types.Project) error { //nolint:gocyclo
|
||||
for name, s := range project.Services {
|
||||
if s.Build == nil && s.Image == "" {
|
||||
if s.Build == nil && s.Image == "" && s.Provider == nil {
|
||||
return fmt.Errorf("service %q has neither an image nor a build context specified: %w", s.Name, errdefs.ErrInvalid)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user