mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	Merge pull request #3057 from crazy-max/update-compose
vendor: update compose-go to v2.4.8
This commit is contained in:
		
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							@@ -6,7 +6,7 @@ require (
 | 
				
			|||||||
	github.com/Masterminds/semver/v3 v3.2.1
 | 
						github.com/Masterminds/semver/v3 v3.2.1
 | 
				
			||||||
	github.com/Microsoft/go-winio v0.6.2
 | 
						github.com/Microsoft/go-winio v0.6.2
 | 
				
			||||||
	github.com/aws/aws-sdk-go-v2/config v1.27.27
 | 
						github.com/aws/aws-sdk-go-v2/config v1.27.27
 | 
				
			||||||
	github.com/compose-spec/compose-go/v2 v2.4.7
 | 
						github.com/compose-spec/compose-go/v2 v2.4.8
 | 
				
			||||||
	github.com/containerd/console v1.0.4
 | 
						github.com/containerd/console v1.0.4
 | 
				
			||||||
	github.com/containerd/containerd/v2 v2.0.2
 | 
						github.com/containerd/containerd/v2 v2.0.2
 | 
				
			||||||
	github.com/containerd/continuity v0.4.5
 | 
						github.com/containerd/continuity v0.4.5
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								go.sum
									
									
									
									
									
								
							@@ -77,8 +77,8 @@ github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e
 | 
				
			|||||||
github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA=
 | 
					github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA=
 | 
				
			||||||
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
 | 
					github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
 | 
				
			||||||
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
 | 
					github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
 | 
				
			||||||
github.com/compose-spec/compose-go/v2 v2.4.7 h1:WNpz5bIbKG+G+w9pfu72B1ZXr+Og9jez8TMEo8ecXPk=
 | 
					github.com/compose-spec/compose-go/v2 v2.4.8 h1:7Myl8wDRl/4mRz77S+eyDJymGGEHu0diQdGSSeyq90A=
 | 
				
			||||||
github.com/compose-spec/compose-go/v2 v2.4.7/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=
 | 
					github.com/compose-spec/compose-go/v2 v2.4.8/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=
 | 
				
			||||||
github.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo=
 | 
					github.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo=
 | 
				
			||||||
github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins=
 | 
					github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins=
 | 
				
			||||||
github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro=
 | 
					github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro=
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										26
									
								
								vendor/github.com/compose-spec/compose-go/v2/cli/options.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								vendor/github.com/compose-spec/compose-go/v2/cli/options.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -26,6 +26,7 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/sirupsen/logrus"
 | 
						"github.com/sirupsen/logrus"
 | 
				
			||||||
 | 
						"gopkg.in/yaml.v3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/compose-spec/compose-go/v2/consts"
 | 
						"github.com/compose-spec/compose-go/v2/consts"
 | 
				
			||||||
	"github.com/compose-spec/compose-go/v2/dotenv"
 | 
						"github.com/compose-spec/compose-go/v2/dotenv"
 | 
				
			||||||
@@ -482,8 +483,27 @@ func (o *ProjectOptions) prepare(ctx context.Context) (*types.ConfigDetails, err
 | 
				
			|||||||
		return configDetails, err
 | 
							return configDetails, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						isNamed := false
 | 
				
			||||||
 | 
						if o.Name == "" {
 | 
				
			||||||
 | 
							type named struct {
 | 
				
			||||||
 | 
								Name string `yaml:"name,omitempty"`
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							// if any of the compose file is named, this is equivalent to user passing --project-name
 | 
				
			||||||
 | 
							for _, cfg := range configDetails.ConfigFiles {
 | 
				
			||||||
 | 
								var n named
 | 
				
			||||||
 | 
								err = yaml.Unmarshal(cfg.Content, &n)
 | 
				
			||||||
 | 
								if err != nil {
 | 
				
			||||||
 | 
									return nil, err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if n.Name != "" {
 | 
				
			||||||
 | 
									isNamed = true
 | 
				
			||||||
 | 
									break
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	o.loadOptions = append(o.loadOptions,
 | 
						o.loadOptions = append(o.loadOptions,
 | 
				
			||||||
		withNamePrecedenceLoad(defaultDir, o),
 | 
							withNamePrecedenceLoad(defaultDir, isNamed, o),
 | 
				
			||||||
		withConvertWindowsPaths(o),
 | 
							withConvertWindowsPaths(o),
 | 
				
			||||||
		withListeners(o))
 | 
							withListeners(o))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -496,13 +516,13 @@ func ProjectFromOptions(ctx context.Context, options *ProjectOptions) (*types.Pr
 | 
				
			|||||||
	return options.LoadProject(ctx)
 | 
						return options.LoadProject(ctx)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func withNamePrecedenceLoad(absWorkingDir string, options *ProjectOptions) func(*loader.Options) {
 | 
					func withNamePrecedenceLoad(absWorkingDir string, namedInYaml bool, options *ProjectOptions) func(*loader.Options) {
 | 
				
			||||||
	return func(opts *loader.Options) {
 | 
						return func(opts *loader.Options) {
 | 
				
			||||||
		if options.Name != "" {
 | 
							if options.Name != "" {
 | 
				
			||||||
			opts.SetProjectName(options.Name, true)
 | 
								opts.SetProjectName(options.Name, true)
 | 
				
			||||||
		} else if nameFromEnv, ok := options.Environment[consts.ComposeProjectName]; ok && nameFromEnv != "" {
 | 
							} else if nameFromEnv, ok := options.Environment[consts.ComposeProjectName]; ok && nameFromEnv != "" {
 | 
				
			||||||
			opts.SetProjectName(nameFromEnv, true)
 | 
								opts.SetProjectName(nameFromEnv, true)
 | 
				
			||||||
		} else {
 | 
							} else if !namedInYaml {
 | 
				
			||||||
			dirname := filepath.Base(absWorkingDir)
 | 
								dirname := filepath.Base(absWorkingDir)
 | 
				
			||||||
			symlink, err := filepath.EvalSymlinks(absWorkingDir)
 | 
								symlink, err := filepath.EvalSymlinks(absWorkingDir)
 | 
				
			||||||
			if err == nil && filepath.Base(symlink) != dirname {
 | 
								if err == nil && filepath.Base(symlink) != dirname {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								vendor/github.com/compose-spec/compose-go/v2/loader/extends.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								vendor/github.com/compose-spec/compose-go/v2/loader/extends.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -27,10 +27,6 @@ import (
 | 
				
			|||||||
	"github.com/compose-spec/compose-go/v2/types"
 | 
						"github.com/compose-spec/compose-go/v2/types"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// as we use another service definition by `extends`, we must exclude attributes which creates dependency to another service
 | 
					 | 
				
			||||||
// see https://github.com/compose-spec/compose-spec/blob/main/05-services.md#restrictions
 | 
					 | 
				
			||||||
var exclusions = []string{"depends_on", "volumes_from"}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func ApplyExtends(ctx context.Context, dict map[string]any, opts *Options, tracker *cycleTracker, post ...PostProcessor) error {
 | 
					func ApplyExtends(ctx context.Context, dict map[string]any, opts *Options, tracker *cycleTracker, post ...PostProcessor) error {
 | 
				
			||||||
	a, ok := dict["services"]
 | 
						a, ok := dict["services"]
 | 
				
			||||||
	if !ok {
 | 
						if !ok {
 | 
				
			||||||
@@ -123,9 +119,6 @@ func applyServiceExtends(ctx context.Context, name string, services map[string]a
 | 
				
			|||||||
			},
 | 
								},
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	for _, exclusion := range exclusions {
 | 
					 | 
				
			||||||
		delete(source, exclusion)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	merged, err := override.ExtendService(source, service)
 | 
						merged, err := override.ExtendService(source, service)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								vendor/github.com/compose-spec/compose-go/v2/loader/interpolate.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/compose-spec/compose-go/v2/loader/interpolate.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -64,6 +64,7 @@ var interpolateTypeCastMapping = map[tree.Path]interp.Cast{
 | 
				
			|||||||
	iPath("networks", tree.PathMatchAll, "external"):               toBoolean,
 | 
						iPath("networks", tree.PathMatchAll, "external"):               toBoolean,
 | 
				
			||||||
	iPath("networks", tree.PathMatchAll, "internal"):               toBoolean,
 | 
						iPath("networks", tree.PathMatchAll, "internal"):               toBoolean,
 | 
				
			||||||
	iPath("networks", tree.PathMatchAll, "attachable"):             toBoolean,
 | 
						iPath("networks", tree.PathMatchAll, "attachable"):             toBoolean,
 | 
				
			||||||
 | 
						iPath("networks", tree.PathMatchAll, "enable_ipv4"):            toBoolean,
 | 
				
			||||||
	iPath("networks", tree.PathMatchAll, "enable_ipv6"):            toBoolean,
 | 
						iPath("networks", tree.PathMatchAll, "enable_ipv6"):            toBoolean,
 | 
				
			||||||
	iPath("volumes", tree.PathMatchAll, "external"):                toBoolean,
 | 
						iPath("volumes", tree.PathMatchAll, "external"):                toBoolean,
 | 
				
			||||||
	iPath("secrets", tree.PathMatchAll, "external"):                toBoolean,
 | 
						iPath("secrets", tree.PathMatchAll, "external"):                toBoolean,
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										14
									
								
								vendor/github.com/compose-spec/compose-go/v2/loader/validate.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								vendor/github.com/compose-spec/compose-go/v2/loader/validate.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -28,7 +28,7 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// checkConsistency validate a compose model is consistent
 | 
					// checkConsistency validate a compose model is consistent
 | 
				
			||||||
func checkConsistency(project *types.Project) error {
 | 
					func checkConsistency(project *types.Project) error {
 | 
				
			||||||
	for _, s := range project.Services {
 | 
						for name, s := range project.Services {
 | 
				
			||||||
		if s.Build == nil && s.Image == "" {
 | 
							if s.Build == nil && s.Image == "" {
 | 
				
			||||||
			return fmt.Errorf("service %q has neither an image nor a build context specified: %w", s.Name, errdefs.ErrInvalid)
 | 
								return fmt.Errorf("service %q has neither an image nor a build context specified: %w", s.Name, errdefs.ErrInvalid)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -38,6 +38,18 @@ func checkConsistency(project *types.Project) error {
 | 
				
			|||||||
				return fmt.Errorf("service %q declares mutualy exclusive dockerfile and dockerfile_inline: %w", s.Name, errdefs.ErrInvalid)
 | 
									return fmt.Errorf("service %q declares mutualy exclusive dockerfile and dockerfile_inline: %w", s.Name, errdefs.ErrInvalid)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								for add, c := range s.Build.AdditionalContexts {
 | 
				
			||||||
 | 
									if target, ok := strings.CutPrefix(c, types.ServicePrefix); ok {
 | 
				
			||||||
 | 
										t, err := project.GetService(target)
 | 
				
			||||||
 | 
										if err != nil {
 | 
				
			||||||
 | 
											return fmt.Errorf("service %q declares unknown service %q as additional contexts %s", name, target, add)
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										if t.Build == nil {
 | 
				
			||||||
 | 
											return fmt.Errorf("service %q declares non-buildable service %q as additional contexts %s", name, target, add)
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if len(s.Build.Platforms) > 0 && s.Platform != "" {
 | 
								if len(s.Build.Platforms) > 0 && s.Platform != "" {
 | 
				
			||||||
				var found bool
 | 
									var found bool
 | 
				
			||||||
				for _, platform := range s.Build.Platforms {
 | 
									for _, platform := range s.Build.Platforms {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										9
									
								
								vendor/github.com/compose-spec/compose-go/v2/paths/context.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/github.com/compose-spec/compose-go/v2/paths/context.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -16,13 +16,20 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package paths
 | 
					package paths
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "strings"
 | 
					import (
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/compose-spec/compose-go/v2/types"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (r *relativePathsResolver) absContextPath(value any) (any, error) {
 | 
					func (r *relativePathsResolver) absContextPath(value any) (any, error) {
 | 
				
			||||||
	v := value.(string)
 | 
						v := value.(string)
 | 
				
			||||||
	if strings.Contains(v, "://") { // `docker-image://` or any builder specific context type
 | 
						if strings.Contains(v, "://") { // `docker-image://` or any builder specific context type
 | 
				
			||||||
		return v, nil
 | 
							return v, nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if strings.HasPrefix(v, types.ServicePrefix) { // `docker-image://` or any builder specific context type
 | 
				
			||||||
 | 
							return v, nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if isRemoteContext(v) {
 | 
						if isRemoteContext(v) {
 | 
				
			||||||
		return v, nil
 | 
							return v, nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										73
									
								
								vendor/github.com/compose-spec/compose-go/v2/schema/compose-spec.json
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										73
									
								
								vendor/github.com/compose-spec/compose-go/v2/schema/compose-spec.json
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "$schema": "https://json-schema.org/draft/2019-09/schema#",
 | 
					  "$schema": "https://json-schema.org/draft-07/schema",
 | 
				
			||||||
  "id": "compose_spec.json",
 | 
					  "$id": "compose_spec.json",
 | 
				
			||||||
  "type": "object",
 | 
					  "type": "object",
 | 
				
			||||||
  "title": "Compose Specification",
 | 
					  "title": "Compose Specification",
 | 
				
			||||||
  "description": "The Compose file is a YAML file defining a multi-containers based application.",
 | 
					  "description": "The Compose file is a YAML file defining a multi-containers based application.",
 | 
				
			||||||
@@ -25,7 +25,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "services": {
 | 
					    "services": {
 | 
				
			||||||
      "id": "#/properties/services",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "patternProperties": {
 | 
					      "patternProperties": {
 | 
				
			||||||
        "^[a-zA-Z0-9._-]+$": {
 | 
					        "^[a-zA-Z0-9._-]+$": {
 | 
				
			||||||
@@ -36,7 +35,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "networks": {
 | 
					    "networks": {
 | 
				
			||||||
      "id": "#/properties/networks",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "patternProperties": {
 | 
					      "patternProperties": {
 | 
				
			||||||
        "^[a-zA-Z0-9._-]+$": {
 | 
					        "^[a-zA-Z0-9._-]+$": {
 | 
				
			||||||
@@ -46,7 +44,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "volumes": {
 | 
					    "volumes": {
 | 
				
			||||||
      "id": "#/properties/volumes",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "patternProperties": {
 | 
					      "patternProperties": {
 | 
				
			||||||
        "^[a-zA-Z0-9._-]+$": {
 | 
					        "^[a-zA-Z0-9._-]+$": {
 | 
				
			||||||
@@ -57,7 +54,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "secrets": {
 | 
					    "secrets": {
 | 
				
			||||||
      "id": "#/properties/secrets",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "patternProperties": {
 | 
					      "patternProperties": {
 | 
				
			||||||
        "^[a-zA-Z0-9._-]+$": {
 | 
					        "^[a-zA-Z0-9._-]+$": {
 | 
				
			||||||
@@ -68,7 +64,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "configs": {
 | 
					    "configs": {
 | 
				
			||||||
      "id": "#/properties/configs",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "patternProperties": {
 | 
					      "patternProperties": {
 | 
				
			||||||
        "^[a-zA-Z0-9._-]+$": {
 | 
					        "^[a-zA-Z0-9._-]+$": {
 | 
				
			||||||
@@ -85,7 +80,6 @@
 | 
				
			|||||||
  "definitions": {
 | 
					  "definitions": {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "service": {
 | 
					    "service": {
 | 
				
			||||||
      "id": "#/definitions/service",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
@@ -246,8 +240,7 @@
 | 
				
			|||||||
        "expose": {
 | 
					        "expose": {
 | 
				
			||||||
          "type": "array",
 | 
					          "type": "array",
 | 
				
			||||||
          "items": {
 | 
					          "items": {
 | 
				
			||||||
            "type": ["string", "number"],
 | 
					            "type": ["string", "number"]
 | 
				
			||||||
            "format": "expose"
 | 
					 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          "uniqueItems": true
 | 
					          "uniqueItems": true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
@@ -327,7 +320,8 @@
 | 
				
			|||||||
                            "^.+$": {"type": ["string", "number"]}
 | 
					                            "^.+$": {"type": ["string", "number"]}
 | 
				
			||||||
                          }
 | 
					                          }
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                        "priority": {"type": "number"}
 | 
					                        "priority": {"type": "number"},
 | 
				
			||||||
 | 
					                        "gw_priority": {"type": "number"}
 | 
				
			||||||
                      },
 | 
					                      },
 | 
				
			||||||
                      "additionalProperties": false,
 | 
					                      "additionalProperties": false,
 | 
				
			||||||
                      "patternProperties": {"^x-": {}}
 | 
					                      "patternProperties": {"^x-": {}}
 | 
				
			||||||
@@ -469,7 +463,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "healthcheck": {
 | 
					    "healthcheck": {
 | 
				
			||||||
      "id": "#/definitions/healthcheck",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "disable": {"type": ["boolean", "string"]},
 | 
					        "disable": {"type": ["boolean", "string"]},
 | 
				
			||||||
@@ -489,7 +482,6 @@
 | 
				
			|||||||
      "patternProperties": {"^x-": {}}
 | 
					      "patternProperties": {"^x-": {}}
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "development": {
 | 
					    "development": {
 | 
				
			||||||
      "id": "#/definitions/development",
 | 
					 | 
				
			||||||
      "type": ["object", "null"],
 | 
					      "type": ["object", "null"],
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "watch": {
 | 
					        "watch": {
 | 
				
			||||||
@@ -513,7 +505,6 @@
 | 
				
			|||||||
      "patternProperties": {"^x-": {}}
 | 
					      "patternProperties": {"^x-": {}}
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "deployment": {
 | 
					    "deployment": {
 | 
				
			||||||
      "id": "#/definitions/deployment",
 | 
					 | 
				
			||||||
      "type": ["object", "null"],
 | 
					      "type": ["object", "null"],
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "mode": {"type": "string"},
 | 
					        "mode": {"type": "string"},
 | 
				
			||||||
@@ -615,7 +606,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "generic_resources": {
 | 
					    "generic_resources": {
 | 
				
			||||||
      "id": "#/definitions/generic_resources",
 | 
					 | 
				
			||||||
      "type": "array",
 | 
					      "type": "array",
 | 
				
			||||||
      "items": {
 | 
					      "items": {
 | 
				
			||||||
        "type": "object",
 | 
					        "type": "object",
 | 
				
			||||||
@@ -636,7 +626,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "devices": {
 | 
					    "devices": {
 | 
				
			||||||
      "id": "#/definitions/devices",
 | 
					 | 
				
			||||||
      "type": "array",
 | 
					      "type": "array",
 | 
				
			||||||
      "items": {
 | 
					      "items": {
 | 
				
			||||||
        "type": "object",
 | 
					        "type": "object",
 | 
				
			||||||
@@ -656,24 +645,26 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "gpus": {
 | 
					    "gpus": {
 | 
				
			||||||
      "id": "#/definitions/gpus",
 | 
					      "oneOf": [
 | 
				
			||||||
      "type": "array",
 | 
					        {"type": "string", "enum": ["all"]},
 | 
				
			||||||
      "items": {
 | 
					        {"type": "array",
 | 
				
			||||||
        "type": "object",
 | 
					         "items": {
 | 
				
			||||||
        "properties": {
 | 
					          "type": "object",
 | 
				
			||||||
          "capabilities": {"$ref": "#/definitions/list_of_strings"},
 | 
					            "properties": {
 | 
				
			||||||
          "count": {"type": ["string", "integer"]},
 | 
					              "capabilities": {"$ref": "#/definitions/list_of_strings"},
 | 
				
			||||||
          "device_ids": {"$ref": "#/definitions/list_of_strings"},
 | 
					              "count": {"type": ["string", "integer"]},
 | 
				
			||||||
          "driver":{"type": "string"},
 | 
					              "device_ids": {"$ref": "#/definitions/list_of_strings"},
 | 
				
			||||||
          "options":{"$ref": "#/definitions/list_or_dict"}
 | 
					              "driver":{"type": "string"},
 | 
				
			||||||
        },
 | 
					              "options":{"$ref": "#/definitions/list_or_dict"}
 | 
				
			||||||
        "additionalProperties": false,
 | 
					            }
 | 
				
			||||||
        "patternProperties": {"^x-": {}}
 | 
					          },
 | 
				
			||||||
      }
 | 
					          "additionalProperties": false,
 | 
				
			||||||
 | 
					          "patternProperties": {"^x-": {}}
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "include": {
 | 
					    "include": {
 | 
				
			||||||
      "id": "#/definitions/include",
 | 
					 | 
				
			||||||
      "oneOf": [
 | 
					      "oneOf": [
 | 
				
			||||||
        {"type": "string"},
 | 
					        {"type": "string"},
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -689,7 +680,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "network": {
 | 
					    "network": {
 | 
				
			||||||
      "id": "#/definitions/network",
 | 
					 | 
				
			||||||
      "type": ["object", "null"],
 | 
					      "type": ["object", "null"],
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "name": {"type": "string"},
 | 
					        "name": {"type": "string"},
 | 
				
			||||||
@@ -743,6 +733,7 @@
 | 
				
			|||||||
          "patternProperties": {"^x-": {}}
 | 
					          "patternProperties": {"^x-": {}}
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "internal": {"type": ["boolean", "string"]},
 | 
					        "internal": {"type": ["boolean", "string"]},
 | 
				
			||||||
 | 
					        "enable_ipv4": {"type": ["boolean", "string"]},
 | 
				
			||||||
        "enable_ipv6": {"type": ["boolean", "string"]},
 | 
					        "enable_ipv6": {"type": ["boolean", "string"]},
 | 
				
			||||||
        "attachable": {"type": ["boolean", "string"]},
 | 
					        "attachable": {"type": ["boolean", "string"]},
 | 
				
			||||||
        "labels": {"$ref": "#/definitions/list_or_dict"}
 | 
					        "labels": {"$ref": "#/definitions/list_or_dict"}
 | 
				
			||||||
@@ -752,7 +743,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "volume": {
 | 
					    "volume": {
 | 
				
			||||||
      "id": "#/definitions/volume",
 | 
					 | 
				
			||||||
      "type": ["object", "null"],
 | 
					      "type": ["object", "null"],
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "name": {"type": "string"},
 | 
					        "name": {"type": "string"},
 | 
				
			||||||
@@ -781,7 +771,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "secret": {
 | 
					    "secret": {
 | 
				
			||||||
      "id": "#/definitions/secret",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "name": {"type": "string"},
 | 
					        "name": {"type": "string"},
 | 
				
			||||||
@@ -808,7 +797,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "config": {
 | 
					    "config": {
 | 
				
			||||||
      "id": "#/definitions/config",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "name": {"type": "string"},
 | 
					        "name": {"type": "string"},
 | 
				
			||||||
@@ -840,7 +828,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "service_hook": {
 | 
					    "service_hook": {
 | 
				
			||||||
      "id": "#/definitions/service_hook",
 | 
					 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "properties": {
 | 
					      "properties": {
 | 
				
			||||||
        "command": {"$ref": "#/definitions/command"},
 | 
					        "command": {"$ref": "#/definitions/command"},
 | 
				
			||||||
@@ -1005,20 +992,6 @@
 | 
				
			|||||||
          ]
 | 
					          ]
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "constraints": {
 | 
					 | 
				
			||||||
      "service": {
 | 
					 | 
				
			||||||
        "id": "#/definitions/constraints/service",
 | 
					 | 
				
			||||||
        "anyOf": [
 | 
					 | 
				
			||||||
          {"required": ["build"]},
 | 
					 | 
				
			||||||
          {"required": ["image"]}
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        "properties": {
 | 
					 | 
				
			||||||
          "build": {
 | 
					 | 
				
			||||||
            "required": ["context"]
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										1
									
								
								vendor/github.com/compose-spec/compose-go/v2/transform/canonical.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/compose-spec/compose-go/v2/transform/canonical.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -32,6 +32,7 @@ func init() {
 | 
				
			|||||||
	transformers["services.*.env_file"] = transformEnvFile
 | 
						transformers["services.*.env_file"] = transformEnvFile
 | 
				
			||||||
	transformers["services.*.label_file"] = transformStringOrList
 | 
						transformers["services.*.label_file"] = transformStringOrList
 | 
				
			||||||
	transformers["services.*.extends"] = transformExtends
 | 
						transformers["services.*.extends"] = transformExtends
 | 
				
			||||||
 | 
						transformers["services.*.gpus"] = transformGpus
 | 
				
			||||||
	transformers["services.*.networks"] = transformServiceNetworks
 | 
						transformers["services.*.networks"] = transformServiceNetworks
 | 
				
			||||||
	transformers["services.*.volumes.*"] = transformVolumeMount
 | 
						transformers["services.*.volumes.*"] = transformVolumeMount
 | 
				
			||||||
	transformers["services.*.dns"] = transformStringOrList
 | 
						transformers["services.*.dns"] = transformStringOrList
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										38
									
								
								vendor/github.com/compose-spec/compose-go/v2/transform/gpus.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								vendor/github.com/compose-spec/compose-go/v2/transform/gpus.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					   Copyright 2020 The Compose Specification Authors.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					   you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					   You may obtain a copy of the License at
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					       http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					   distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					   See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					   limitations under the License.
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package transform
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/compose-spec/compose-go/v2/tree"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func transformGpus(data any, p tree.Path, ignoreParseError bool) (any, error) {
 | 
				
			||||||
 | 
						switch v := data.(type) {
 | 
				
			||||||
 | 
						case []any:
 | 
				
			||||||
 | 
							return transformSequence(v, p, ignoreParseError)
 | 
				
			||||||
 | 
						case string:
 | 
				
			||||||
 | 
							return []any{
 | 
				
			||||||
 | 
								map[string]any{
 | 
				
			||||||
 | 
									"count": "all",
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}, nil
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							return data, fmt.Errorf("%s: invalid type %T for gpus", p, v)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										6
									
								
								vendor/github.com/compose-spec/compose-go/v2/types/derived.gen.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/compose-spec/compose-go/v2/types/derived.gen.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1452,6 +1452,12 @@ func deriveDeepCopy_24(dst, src *NetworkConfig) {
 | 
				
			|||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		dst.CustomLabels = nil
 | 
							dst.CustomLabels = nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if src.EnableIPv4 == nil {
 | 
				
			||||||
 | 
							dst.EnableIPv4 = nil
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							dst.EnableIPv4 = new(bool)
 | 
				
			||||||
 | 
							*dst.EnableIPv4 = *src.EnableIPv4
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if src.EnableIPv6 == nil {
 | 
						if src.EnableIPv6 == nil {
 | 
				
			||||||
		dst.EnableIPv6 = nil
 | 
							dst.EnableIPv6 = nil
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										16
									
								
								vendor/github.com/compose-spec/compose-go/v2/types/types.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/github.com/compose-spec/compose-go/v2/types/types.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -438,13 +438,14 @@ type PlacementPreferences struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// ServiceNetworkConfig is the network configuration for a service
 | 
					// ServiceNetworkConfig is the network configuration for a service
 | 
				
			||||||
type ServiceNetworkConfig struct {
 | 
					type ServiceNetworkConfig struct {
 | 
				
			||||||
	Priority     int      `yaml:"priority,omitempty" json:"priority,omitempty"`
 | 
						Priority        int      `yaml:"priority,omitempty" json:"priority,omitempty"`
 | 
				
			||||||
	Aliases      []string `yaml:"aliases,omitempty" json:"aliases,omitempty"`
 | 
						GatewayPriority int      `yaml:"gw_priority,omitempty" json:"gw_priority,omitempty"`
 | 
				
			||||||
	Ipv4Address  string   `yaml:"ipv4_address,omitempty" json:"ipv4_address,omitempty"`
 | 
						Aliases         []string `yaml:"aliases,omitempty" json:"aliases,omitempty"`
 | 
				
			||||||
	Ipv6Address  string   `yaml:"ipv6_address,omitempty" json:"ipv6_address,omitempty"`
 | 
						Ipv4Address     string   `yaml:"ipv4_address,omitempty" json:"ipv4_address,omitempty"`
 | 
				
			||||||
	LinkLocalIPs []string `yaml:"link_local_ips,omitempty" json:"link_local_ips,omitempty"`
 | 
						Ipv6Address     string   `yaml:"ipv6_address,omitempty" json:"ipv6_address,omitempty"`
 | 
				
			||||||
	MacAddress   string   `yaml:"mac_address,omitempty" json:"mac_address,omitempty"`
 | 
						LinkLocalIPs    []string `yaml:"link_local_ips,omitempty" json:"link_local_ips,omitempty"`
 | 
				
			||||||
	DriverOpts   Options  `yaml:"driver_opts,omitempty" json:"driver_opts,omitempty"`
 | 
						MacAddress      string   `yaml:"mac_address,omitempty" json:"mac_address,omitempty"`
 | 
				
			||||||
 | 
						DriverOpts      Options  `yaml:"driver_opts,omitempty" json:"driver_opts,omitempty"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
 | 
						Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -688,6 +689,7 @@ type NetworkConfig struct {
 | 
				
			|||||||
	Attachable   bool       `yaml:"attachable,omitempty" json:"attachable,omitempty"`
 | 
						Attachable   bool       `yaml:"attachable,omitempty" json:"attachable,omitempty"`
 | 
				
			||||||
	Labels       Labels     `yaml:"labels,omitempty" json:"labels,omitempty"`
 | 
						Labels       Labels     `yaml:"labels,omitempty" json:"labels,omitempty"`
 | 
				
			||||||
	CustomLabels Labels     `yaml:"-" json:"-"`
 | 
						CustomLabels Labels     `yaml:"-" json:"-"`
 | 
				
			||||||
 | 
						EnableIPv4   *bool      `yaml:"enable_ipv4,omitempty" json:"enable_ipv4,omitempty"`
 | 
				
			||||||
	EnableIPv6   *bool      `yaml:"enable_ipv6,omitempty" json:"enable_ipv6,omitempty"`
 | 
						EnableIPv6   *bool      `yaml:"enable_ipv6,omitempty" json:"enable_ipv6,omitempty"`
 | 
				
			||||||
	Extensions   Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
 | 
						Extensions   Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							@@ -130,7 +130,7 @@ github.com/cenkalti/backoff/v4
 | 
				
			|||||||
# github.com/cespare/xxhash/v2 v2.3.0
 | 
					# github.com/cespare/xxhash/v2 v2.3.0
 | 
				
			||||||
## explicit; go 1.11
 | 
					## explicit; go 1.11
 | 
				
			||||||
github.com/cespare/xxhash/v2
 | 
					github.com/cespare/xxhash/v2
 | 
				
			||||||
# github.com/compose-spec/compose-go/v2 v2.4.7
 | 
					# github.com/compose-spec/compose-go/v2 v2.4.8
 | 
				
			||||||
## explicit; go 1.21
 | 
					## explicit; go 1.21
 | 
				
			||||||
github.com/compose-spec/compose-go/v2/cli
 | 
					github.com/compose-spec/compose-go/v2/cli
 | 
				
			||||||
github.com/compose-spec/compose-go/v2/consts
 | 
					github.com/compose-spec/compose-go/v2/consts
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user