From 0b4e624aaacd07ab8dbc24c5282f3fe2e81c3130 Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Thu, 10 Apr 2025 18:02:16 +0200 Subject: [PATCH] bump compose-go to version v2.6.0 Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- go.mod | 3 +- go.sum | 6 +- .../compose-spec/compose-go/v2/dotenv/env.go | 4 +- .../compose-go/v2/dotenv/format.go | 16 +- .../compose-go/v2/dotenv/godotenv.go | 11 +- .../compose-spec/compose-go/v2/graph/cycle.go | 2 +- .../compose-go/v2/graph/traversal.go | 2 +- .../compose-go/v2/loader/loader.go | 8 +- .../compose-go/v2/loader/reset.go | 6 + .../compose-go/v2/loader/validate.go | 2 +- .../compose-go/v2/override/merge.go | 18 +- .../compose-go/v2/schema/compose-spec.json | 28 +- .../compose-go/v2/types/derived.gen.go | 432 ++++++++++-------- .../compose-go/v2/types/project.go | 99 ++-- .../compose-spec/compose-go/v2/types/types.go | 23 +- .../compose-go/v2/utils/collectionutils.go | 12 +- vendor/golang.org/x/exp/LICENSE | 27 -- vendor/golang.org/x/exp/PATENTS | 22 - .../x/exp/constraints/constraints.go | 54 --- vendor/golang.org/x/exp/maps/maps.go | 86 ---- vendor/golang.org/x/exp/slices/slices.go | 182 -------- vendor/golang.org/x/exp/slices/sort.go | 115 ----- vendor/modules.txt | 7 +- 23 files changed, 397 insertions(+), 768 deletions(-) delete mode 100644 vendor/golang.org/x/exp/LICENSE delete mode 100644 vendor/golang.org/x/exp/PATENTS delete mode 100644 vendor/golang.org/x/exp/constraints/constraints.go delete mode 100644 vendor/golang.org/x/exp/maps/maps.go delete mode 100644 vendor/golang.org/x/exp/slices/slices.go delete mode 100644 vendor/golang.org/x/exp/slices/sort.go diff --git a/go.mod b/go.mod index 75f250c9..deca3ffb 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/Microsoft/go-winio v0.6.2 github.com/aws/aws-sdk-go-v2/config v1.27.27 - github.com/compose-spec/compose-go/v2 v2.4.9 + github.com/compose-spec/compose-go/v2 v2.6.0 github.com/containerd/console v1.0.4 github.com/containerd/containerd/v2 v2.0.4 github.com/containerd/continuity v0.4.5 @@ -169,7 +169,6 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect golang.org/x/crypto v0.37.0 // indirect - golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect golang.org/x/net v0.39.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/time v0.11.0 // indirect diff --git a/go.sum b/go.sum index 6f5f30f2..cadb1e21 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= -github.com/compose-spec/compose-go/v2 v2.4.9 h1:2K4TDw+1ba2idiR6empXHKRXvWYpnvAKoNQy93/sSOs= -github.com/compose-spec/compose-go/v2 v2.4.9/go.mod h1:6k5l/0TxCg0/2uLEhRVEsoBWBprS2uvZi32J7xub3lo= +github.com/compose-spec/compose-go/v2 v2.6.0 h1:/+oBD2ixSENOeN/TlJqWZmUak0xM8A7J08w/z661Wd4= +github.com/compose-spec/compose-go/v2 v2.6.0/go.mod h1:vPlkN0i+0LjLf9rv52lodNMUTJF5YHVfHVGLLIP67NA= 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/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro= @@ -494,8 +494,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= -golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM= -golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= diff --git a/vendor/github.com/compose-spec/compose-go/v2/dotenv/env.go b/vendor/github.com/compose-spec/compose-go/v2/dotenv/env.go index cc472a60..b01f9935 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/dotenv/env.go +++ b/vendor/github.com/compose-spec/compose-go/v2/dotenv/env.go @@ -35,7 +35,7 @@ func GetEnvFromFile(currentEnv map[string]string, filenames []string) (map[strin s, err := os.Stat(dotEnvFile) if os.IsNotExist(err) { - return envMap, fmt.Errorf("Couldn't find env file: %s", dotEnvFile) + return envMap, fmt.Errorf("couldn't find env file: %s", dotEnvFile) } if err != nil { return envMap, err @@ -50,7 +50,7 @@ func GetEnvFromFile(currentEnv map[string]string, filenames []string) (map[strin b, err := os.ReadFile(dotEnvFile) if os.IsNotExist(err) { - return nil, fmt.Errorf("Couldn't read env file: %s", dotEnvFile) + return nil, fmt.Errorf("couldn't read env file: %s", dotEnvFile) } if err != nil { return envMap, err diff --git a/vendor/github.com/compose-spec/compose-go/v2/dotenv/format.go b/vendor/github.com/compose-spec/compose-go/v2/dotenv/format.go index 7b744bc0..0234716c 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/dotenv/format.go +++ b/vendor/github.com/compose-spec/compose-go/v2/dotenv/format.go @@ -24,28 +24,28 @@ import ( const DotEnv = ".env" var formats = map[string]Parser{ - DotEnv: func(r io.Reader, filename string, lookup func(key string) (string, bool)) (map[string]string, error) { - m, err := ParseWithLookup(r, lookup) + DotEnv: func(r io.Reader, filename string, vars map[string]string, lookup func(key string) (string, bool)) error { + err := parseWithLookup(r, vars, lookup) if err != nil { - return nil, fmt.Errorf("failed to read %s: %w", filename, err) + return fmt.Errorf("failed to read %s: %w", filename, err) } - return m, nil + return nil }, } -type Parser func(r io.Reader, filename string, lookup func(key string) (string, bool)) (map[string]string, error) +type Parser func(r io.Reader, filename string, vars map[string]string, lookup func(key string) (string, bool)) error func RegisterFormat(format string, p Parser) { formats[format] = p } -func ParseWithFormat(r io.Reader, filename string, resolve LookupFn, format string) (map[string]string, error) { +func ParseWithFormat(r io.Reader, filename string, vars map[string]string, resolve LookupFn, format string) error { if format == "" { format = DotEnv } fn, ok := formats[format] if !ok { - return nil, fmt.Errorf("unsupported env_file format %q", format) + return fmt.Errorf("unsupported env_file format %q", format) } - return fn(r, filename, resolve) + return fn(r, filename, vars, resolve) } diff --git a/vendor/github.com/compose-spec/compose-go/v2/dotenv/godotenv.go b/vendor/github.com/compose-spec/compose-go/v2/dotenv/godotenv.go index 215e86f7..8f4fdf6a 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/dotenv/godotenv.go +++ b/vendor/github.com/compose-spec/compose-go/v2/dotenv/godotenv.go @@ -41,16 +41,23 @@ func Parse(r io.Reader) (map[string]string, error) { // ParseWithLookup reads an env file from io.Reader, returning a map of keys and values. func ParseWithLookup(r io.Reader, lookupFn LookupFn) (map[string]string, error) { + vars := map[string]string{} + err := parseWithLookup(r, vars, lookupFn) + return vars, err +} + +// ParseWithLookup reads an env file from io.Reader, returning a map of keys and values. +func parseWithLookup(r io.Reader, vars map[string]string, lookupFn LookupFn) error { data, err := io.ReadAll(r) if err != nil { - return nil, err + return err } // seek past the UTF-8 BOM if it exists (particularly on Windows, some // editors tend to add it, and it'll cause parsing to fail) data = bytes.TrimPrefix(data, utf8BOM) - return UnmarshalBytesWithLookup(data, lookupFn) + return newParser().parse(string(data), vars, lookupFn) } // Load will read your env file(s) and load them into ENV for this process. diff --git a/vendor/github.com/compose-spec/compose-go/v2/graph/cycle.go b/vendor/github.com/compose-spec/compose-go/v2/graph/cycle.go index 60c37cef..58130ad6 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/graph/cycle.go +++ b/vendor/github.com/compose-spec/compose-go/v2/graph/cycle.go @@ -18,11 +18,11 @@ package graph import ( "fmt" + "slices" "strings" "github.com/compose-spec/compose-go/v2/types" "github.com/compose-spec/compose-go/v2/utils" - "golang.org/x/exp/slices" ) // CheckCycle analyze project's depends_on relation and report an error on cycle detection diff --git a/vendor/github.com/compose-spec/compose-go/v2/graph/traversal.go b/vendor/github.com/compose-spec/compose-go/v2/graph/traversal.go index f0ee6c09..99ab4a4b 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/graph/traversal.go +++ b/vendor/github.com/compose-spec/compose-go/v2/graph/traversal.go @@ -18,9 +18,9 @@ package graph import ( "context" + "slices" "sync" - "golang.org/x/exp/slices" "golang.org/x/sync/errgroup" ) diff --git a/vendor/github.com/compose-spec/compose-go/v2/loader/loader.go b/vendor/github.com/compose-spec/compose-go/v2/loader/loader.go index d413cba0..6b1d13ce 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/loader/loader.go +++ b/vendor/github.com/compose-spec/compose-go/v2/loader/loader.go @@ -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 diff --git a/vendor/github.com/compose-spec/compose-go/v2/loader/reset.go b/vendor/github.com/compose-spec/compose-go/v2/loader/reset.go index 33ea4c2c..f975d6d2 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/loader/reset.go +++ b/vendor/github.com/compose-spec/compose-go/v2/loader/reset.go @@ -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 { diff --git a/vendor/github.com/compose-spec/compose-go/v2/loader/validate.go b/vendor/github.com/compose-spec/compose-go/v2/loader/validate.go index aa570888..0d95325d 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/loader/validate.go +++ b/vendor/github.com/compose-spec/compose-go/v2/loader/validate.go @@ -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) } diff --git a/vendor/github.com/compose-spec/compose-go/v2/override/merge.go b/vendor/github.com/compose-spec/compose-go/v2/override/merge.go index 8cb0ed52..c6358ed7 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/override/merge.go +++ b/vendor/github.com/compose-spec/compose-go/v2/override/merge.go @@ -19,10 +19,9 @@ package override import ( "cmp" "fmt" - "strings" + "slices" "github.com/compose-spec/compose-go/v2/tree" - "golang.org/x/exp/slices" ) // Merge applies overrides to a config model @@ -62,6 +61,7 @@ func init() { mergeSpecials["services.*.extra_hosts"] = mergeExtraHosts mergeSpecials["services.*.healthcheck.test"] = override mergeSpecials["services.*.labels"] = mergeToSequence + mergeSpecials["services.*.volumes.*.volume.labels"] = mergeToSequence mergeSpecials["services.*.logging"] = mergeLogging mergeSpecials["services.*.networks"] = mergeNetworks mergeSpecials["services.*.sysctls"] = mergeToSequence @@ -104,7 +104,7 @@ func mergeYaml(e any, o any, p tree.Path) (any, error) { func mergeMappings(mapping map[string]any, other map[string]any, p tree.Path) (map[string]any, error) { for k, v := range other { e, ok := mapping[k] - if !ok || strings.HasPrefix(k, "x-") { + if !ok { mapping[k] = v continue } @@ -227,9 +227,17 @@ func mergeUlimit(_ any, o any, p tree.Path) (any, error) { func mergeIPAMConfig(c any, o any, path tree.Path) (any, error) { var ipamConfigs []any - for _, original := range c.([]any) { + configs, ok := c.([]any) + if !ok { + return o, fmt.Errorf("%s: unexpected type %T", path, c) + } + overrides, ok := o.([]any) + if !ok { + return o, fmt.Errorf("%s: unexpected type %T", path, c) + } + for _, original := range configs { right := convertIntoMapping(original, nil) - for _, override := range o.([]any) { + for _, override := range overrides { left := convertIntoMapping(override, nil) if left["subnet"] != right["subnet"] { // check if left is already in ipamConfigs, add it if not and continue with the next config diff --git a/vendor/github.com/compose-spec/compose-go/v2/schema/compose-spec.json b/vendor/github.com/compose-spec/compose-go/v2/schema/compose-spec.json index 4b6df9a8..ee1137fb 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/schema/compose-spec.json +++ b/vendor/github.com/compose-spec/compose-go/v2/schema/compose-spec.json @@ -259,6 +259,20 @@ } ] }, + "provider": { + "type": "object", + "properties": { + "type": {"type": "string"}, + "options": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number", "null"]} + } + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "extra_hosts": {"$ref": "#/definitions/extra_hosts"}, "gpus": {"$ref": "#/definitions/gpus"}, @@ -279,7 +293,6 @@ "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "logging": { "type": "object", - "properties": { "driver": {"type": "string"}, "options": { @@ -405,7 +418,9 @@ "type": "object", "required": ["type"], "properties": { - "type": {"type": "string"}, + "type": {"type": "string", + "enum": ["bind", "volume", "tmpfs", "cluster", "image"] + }, "source": {"type": "string"}, "target": {"type": "string"}, "read_only": {"type": ["boolean", "string"]}, @@ -424,6 +439,7 @@ "volume": { "type": "object", "properties": { + "labels": {"$ref": "#/definitions/list_or_dict"}, "nocopy": {"type": ["boolean", "string"]}, "subpath": {"type": "string"} }, @@ -443,6 +459,14 @@ }, "additionalProperties": false, "patternProperties": {"^x-": {}} + }, + "image": { + "type": "object", + "properties": { + "subpath": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} } }, "additionalProperties": false, diff --git a/vendor/github.com/compose-spec/compose-go/v2/types/derived.gen.go b/vendor/github.com/compose-spec/compose-go/v2/types/derived.gen.go index fd8e059e..2d60daee 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/types/derived.gen.go +++ b/vendor/github.com/compose-spec/compose-go/v2/types/derived.gen.go @@ -355,9 +355,15 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } copy(dst.Entrypoint, src.Entrypoint) } + if src.Provider == nil { + dst.Provider = nil + } else { + dst.Provider = new(ServiceProviderConfig) + deriveDeepCopy_13(dst.Provider, src.Provider) + } if src.Environment != nil { dst.Environment = make(map[string]*string, len(src.Environment)) - deriveDeepCopy_13(dst.Environment, src.Environment) + deriveDeepCopy_14(dst.Environment, src.Environment) } else { dst.Environment = nil } @@ -423,7 +429,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } if src.ExtraHosts != nil { dst.ExtraHosts = make(map[string][]string, len(src.ExtraHosts)) - deriveDeepCopy_14(dst.ExtraHosts, src.ExtraHosts) + deriveDeepCopy_15(dst.ExtraHosts, src.ExtraHosts) } else { dst.ExtraHosts = nil } @@ -461,14 +467,14 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } else { dst.Gpus = make([]DeviceRequest, len(src.Gpus)) } - deriveDeepCopy_15(dst.Gpus, src.Gpus) + deriveDeepCopy_16(dst.Gpus, src.Gpus) } dst.Hostname = src.Hostname if src.HealthCheck == nil { dst.HealthCheck = nil } else { dst.HealthCheck = new(HealthCheckConfig) - deriveDeepCopy_16(dst.HealthCheck, src.HealthCheck) + deriveDeepCopy_17(dst.HealthCheck, src.HealthCheck) } dst.Image = src.Image if src.Init == nil { @@ -531,7 +537,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { dst.Logging = nil } else { dst.Logging = new(LoggingConfig) - deriveDeepCopy_17(dst.Logging, src.Logging) + deriveDeepCopy_18(dst.Logging, src.Logging) } dst.LogDriver = src.LogDriver if src.LogOpt != nil { @@ -549,7 +555,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { dst.NetworkMode = src.NetworkMode if src.Networks != nil { dst.Networks = make(map[string]*ServiceNetworkConfig, len(src.Networks)) - deriveDeepCopy_18(dst.Networks, src.Networks) + deriveDeepCopy_19(dst.Networks, src.Networks) } else { dst.Networks = nil } @@ -574,7 +580,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } else { dst.Ports = make([]ServicePortConfig, len(src.Ports)) } - deriveDeepCopy_19(dst.Ports, src.Ports) + deriveDeepCopy_20(dst.Ports, src.Ports) } dst.Privileged = src.Privileged dst.PullPolicy = src.PullPolicy @@ -603,7 +609,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } else { dst.Secrets = make([]ServiceSecretConfig, len(src.Secrets)) } - deriveDeepCopy_20(dst.Secrets, src.Secrets) + deriveDeepCopy_21(dst.Secrets, src.Secrets) } if src.SecurityOpt == nil { dst.SecurityOpt = nil @@ -665,7 +671,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { dst.Tty = src.Tty if src.Ulimits != nil { dst.Ulimits = make(map[string]*UlimitsConfig, len(src.Ulimits)) - deriveDeepCopy_21(dst.Ulimits, src.Ulimits) + deriveDeepCopy_22(dst.Ulimits, src.Ulimits) } else { dst.Ulimits = nil } @@ -689,7 +695,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } else { dst.Volumes = make([]ServiceVolumeConfig, len(src.Volumes)) } - deriveDeepCopy_22(dst.Volumes, src.Volumes) + deriveDeepCopy_23(dst.Volumes, src.Volumes) } if src.VolumesFrom == nil { dst.VolumesFrom = nil @@ -726,7 +732,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } else { dst.PostStart = make([]ServiceHook, len(src.PostStart)) } - deriveDeepCopy_23(dst.PostStart, src.PostStart) + deriveDeepCopy_24(dst.PostStart, src.PostStart) } if src.PreStop == nil { dst.PreStop = nil @@ -744,7 +750,7 @@ func deriveDeepCopyService(dst, src *ServiceConfig) { } else { dst.PreStop = make([]ServiceHook, len(src.PreStop)) } - deriveDeepCopy_23(dst.PreStop, src.PreStop) + deriveDeepCopy_24(dst.PreStop, src.PreStop) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -770,7 +776,7 @@ func deriveDeepCopy_(dst, src map[string]NetworkConfig) { for src_key, src_value := range src { func() { field := new(NetworkConfig) - deriveDeepCopy_24(field, &src_value) + deriveDeepCopy_25(field, &src_value) dst[src_key] = *field }() } @@ -781,7 +787,7 @@ func deriveDeepCopy_1(dst, src map[string]VolumeConfig) { for src_key, src_value := range src { func() { field := new(VolumeConfig) - deriveDeepCopy_25(field, &src_value) + deriveDeepCopy_26(field, &src_value) dst[src_key] = *field }() } @@ -792,7 +798,7 @@ func deriveDeepCopy_2(dst, src map[string]SecretConfig) { for src_key, src_value := range src { func() { field := new(SecretConfig) - deriveDeepCopy_26(field, &src_value) + deriveDeepCopy_27(field, &src_value) dst[src_key] = *field }() } @@ -803,7 +809,7 @@ func deriveDeepCopy_3(dst, src map[string]ConfigObjConfig) { for src_key, src_value := range src { func() { field := new(ConfigObjConfig) - deriveDeepCopy_27(field, &src_value) + deriveDeepCopy_28(field, &src_value) dst[src_key] = *field }() } @@ -841,7 +847,7 @@ func deriveDeepCopy_5(dst, src *BuildConfig) { } if src.Args != nil { dst.Args = make(map[string]*string, len(src.Args)) - deriveDeepCopy_13(dst.Args, src.Args) + deriveDeepCopy_14(dst.Args, src.Args) } else { dst.Args = nil } @@ -915,7 +921,7 @@ func deriveDeepCopy_5(dst, src *BuildConfig) { dst.Pull = src.Pull if src.ExtraHosts != nil { dst.ExtraHosts = make(map[string][]string, len(src.ExtraHosts)) - deriveDeepCopy_14(dst.ExtraHosts, src.ExtraHosts) + deriveDeepCopy_15(dst.ExtraHosts, src.ExtraHosts) } else { dst.ExtraHosts = nil } @@ -938,7 +944,7 @@ func deriveDeepCopy_5(dst, src *BuildConfig) { } else { dst.Secrets = make([]ServiceSecretConfig, len(src.Secrets)) } - deriveDeepCopy_20(dst.Secrets, src.Secrets) + deriveDeepCopy_21(dst.Secrets, src.Secrets) } dst.ShmSize = src.ShmSize if src.Tags == nil { @@ -961,7 +967,7 @@ func deriveDeepCopy_5(dst, src *BuildConfig) { } if src.Ulimits != nil { dst.Ulimits = make(map[string]*UlimitsConfig, len(src.Ulimits)) - deriveDeepCopy_21(dst.Ulimits, src.Ulimits) + deriveDeepCopy_22(dst.Ulimits, src.Ulimits) } else { dst.Ulimits = nil } @@ -1010,7 +1016,7 @@ func deriveDeepCopy_6(dst, src *DevelopConfig) { } else { dst.Watch = make([]Trigger, len(src.Watch)) } - deriveDeepCopy_28(dst.Watch, src.Watch) + deriveDeepCopy_29(dst.Watch, src.Watch) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -1039,7 +1045,7 @@ func deriveDeepCopy_7(dst, src *BlkioConfig) { } else { dst.WeightDevice = make([]WeightDevice, len(src.WeightDevice)) } - deriveDeepCopy_29(dst.WeightDevice, src.WeightDevice) + deriveDeepCopy_30(dst.WeightDevice, src.WeightDevice) } if src.DeviceReadBps == nil { dst.DeviceReadBps = nil @@ -1057,7 +1063,7 @@ func deriveDeepCopy_7(dst, src *BlkioConfig) { } else { dst.DeviceReadBps = make([]ThrottleDevice, len(src.DeviceReadBps)) } - deriveDeepCopy_30(dst.DeviceReadBps, src.DeviceReadBps) + deriveDeepCopy_31(dst.DeviceReadBps, src.DeviceReadBps) } if src.DeviceReadIOps == nil { dst.DeviceReadIOps = nil @@ -1075,7 +1081,7 @@ func deriveDeepCopy_7(dst, src *BlkioConfig) { } else { dst.DeviceReadIOps = make([]ThrottleDevice, len(src.DeviceReadIOps)) } - deriveDeepCopy_30(dst.DeviceReadIOps, src.DeviceReadIOps) + deriveDeepCopy_31(dst.DeviceReadIOps, src.DeviceReadIOps) } if src.DeviceWriteBps == nil { dst.DeviceWriteBps = nil @@ -1093,7 +1099,7 @@ func deriveDeepCopy_7(dst, src *BlkioConfig) { } else { dst.DeviceWriteBps = make([]ThrottleDevice, len(src.DeviceWriteBps)) } - deriveDeepCopy_30(dst.DeviceWriteBps, src.DeviceWriteBps) + deriveDeepCopy_31(dst.DeviceWriteBps, src.DeviceWriteBps) } if src.DeviceWriteIOps == nil { dst.DeviceWriteIOps = nil @@ -1111,7 +1117,7 @@ func deriveDeepCopy_7(dst, src *BlkioConfig) { } else { dst.DeviceWriteIOps = make([]ThrottleDevice, len(src.DeviceWriteIOps)) } - deriveDeepCopy_30(dst.DeviceWriteIOps, src.DeviceWriteIOps) + deriveDeepCopy_31(dst.DeviceWriteIOps, src.DeviceWriteIOps) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -1126,7 +1132,7 @@ func deriveDeepCopy_8(dst, src []ServiceConfigObjConfig) { for src_i, src_value := range src { func() { field := new(ServiceConfigObjConfig) - deriveDeepCopy_31(field, &src_value) + deriveDeepCopy_32(field, &src_value) dst[src_i] = *field }() } @@ -1150,7 +1156,7 @@ func deriveDeepCopy_10(dst, src map[string]ServiceDependency) { for src_key, src_value := range src { func() { field := new(ServiceDependency) - deriveDeepCopy_32(field, &src_value) + deriveDeepCopy_33(field, &src_value) dst[src_key] = *field }() } @@ -1175,28 +1181,28 @@ func deriveDeepCopy_11(dst, src *DeployConfig) { dst.UpdateConfig = nil } else { dst.UpdateConfig = new(UpdateConfig) - deriveDeepCopy_33(dst.UpdateConfig, src.UpdateConfig) + deriveDeepCopy_34(dst.UpdateConfig, src.UpdateConfig) } if src.RollbackConfig == nil { dst.RollbackConfig = nil } else { dst.RollbackConfig = new(UpdateConfig) - deriveDeepCopy_33(dst.RollbackConfig, src.RollbackConfig) + deriveDeepCopy_34(dst.RollbackConfig, src.RollbackConfig) } func() { field := new(Resources) - deriveDeepCopy_34(field, &src.Resources) + deriveDeepCopy_35(field, &src.Resources) dst.Resources = *field }() if src.RestartPolicy == nil { dst.RestartPolicy = nil } else { dst.RestartPolicy = new(RestartPolicy) - deriveDeepCopy_35(dst.RestartPolicy, src.RestartPolicy) + deriveDeepCopy_36(dst.RestartPolicy, src.RestartPolicy) } func() { field := new(Placement) - deriveDeepCopy_36(field, &src.Placement) + deriveDeepCopy_37(field, &src.Placement) dst.Placement = *field }() dst.EndpointMode = src.EndpointMode @@ -1213,14 +1219,31 @@ func deriveDeepCopy_12(dst, src []DeviceMapping) { for src_i, src_value := range src { func() { field := new(DeviceMapping) - deriveDeepCopy_37(field, &src_value) + deriveDeepCopy_38(field, &src_value) dst[src_i] = *field }() } } // deriveDeepCopy_13 recursively copies the contents of src into dst. -func deriveDeepCopy_13(dst, src map[string]*string) { +func deriveDeepCopy_13(dst, src *ServiceProviderConfig) { + dst.Type = src.Type + if src.Options != nil { + dst.Options = make(map[string]string, len(src.Options)) + deriveDeepCopy_4(dst.Options, src.Options) + } else { + dst.Options = nil + } + if src.Extensions != nil { + dst.Extensions = make(map[string]any, len(src.Extensions)) + src.Extensions.DeepCopy(dst.Extensions) + } else { + dst.Extensions = nil + } +} + +// deriveDeepCopy_14 recursively copies the contents of src into dst. +func deriveDeepCopy_14(dst, src map[string]*string) { for src_key, src_value := range src { if src_value == nil { dst[src_key] = nil @@ -1234,8 +1257,8 @@ func deriveDeepCopy_13(dst, src map[string]*string) { } } -// deriveDeepCopy_14 recursively copies the contents of src into dst. -func deriveDeepCopy_14(dst, src map[string][]string) { +// deriveDeepCopy_15 recursively copies the contents of src into dst. +func deriveDeepCopy_15(dst, src map[string][]string) { for src_key, src_value := range src { if src_value == nil { dst[src_key] = nil @@ -1261,19 +1284,19 @@ func deriveDeepCopy_14(dst, src map[string][]string) { } } -// deriveDeepCopy_15 recursively copies the contents of src into dst. -func deriveDeepCopy_15(dst, src []DeviceRequest) { +// deriveDeepCopy_16 recursively copies the contents of src into dst. +func deriveDeepCopy_16(dst, src []DeviceRequest) { for src_i, src_value := range src { func() { field := new(DeviceRequest) - deriveDeepCopy_38(field, &src_value) + deriveDeepCopy_39(field, &src_value) dst[src_i] = *field }() } } -// deriveDeepCopy_16 recursively copies the contents of src into dst. -func deriveDeepCopy_16(dst, src *HealthCheckConfig) { +// deriveDeepCopy_17 recursively copies the contents of src into dst. +func deriveDeepCopy_17(dst, src *HealthCheckConfig) { if src.Test == nil { dst.Test = nil } else { @@ -1331,8 +1354,8 @@ func deriveDeepCopy_16(dst, src *HealthCheckConfig) { } } -// deriveDeepCopy_17 recursively copies the contents of src into dst. -func deriveDeepCopy_17(dst, src *LoggingConfig) { +// deriveDeepCopy_18 recursively copies the contents of src into dst. +func deriveDeepCopy_18(dst, src *LoggingConfig) { dst.Driver = src.Driver if src.Options != nil { dst.Options = make(map[string]string, len(src.Options)) @@ -1348,8 +1371,8 @@ func deriveDeepCopy_17(dst, src *LoggingConfig) { } } -// deriveDeepCopy_18 recursively copies the contents of src into dst. -func deriveDeepCopy_18(dst, src map[string]*ServiceNetworkConfig) { +// deriveDeepCopy_19 recursively copies the contents of src into dst. +func deriveDeepCopy_19(dst, src map[string]*ServiceNetworkConfig) { for src_key, src_value := range src { if src_value == nil { dst[src_key] = nil @@ -1358,27 +1381,16 @@ func deriveDeepCopy_18(dst, src map[string]*ServiceNetworkConfig) { dst[src_key] = nil } else { dst[src_key] = new(ServiceNetworkConfig) - deriveDeepCopy_39(dst[src_key], src_value) + deriveDeepCopy_40(dst[src_key], src_value) } } } -// deriveDeepCopy_19 recursively copies the contents of src into dst. -func deriveDeepCopy_19(dst, src []ServicePortConfig) { +// deriveDeepCopy_20 recursively copies the contents of src into dst. +func deriveDeepCopy_20(dst, src []ServicePortConfig) { for src_i, src_value := range src { func() { field := new(ServicePortConfig) - deriveDeepCopy_40(field, &src_value) - dst[src_i] = *field - }() - } -} - -// deriveDeepCopy_20 recursively copies the contents of src into dst. -func deriveDeepCopy_20(dst, src []ServiceSecretConfig) { - for src_i, src_value := range src { - func() { - field := new(ServiceSecretConfig) deriveDeepCopy_41(field, &src_value) dst[src_i] = *field }() @@ -1386,7 +1398,18 @@ func deriveDeepCopy_20(dst, src []ServiceSecretConfig) { } // deriveDeepCopy_21 recursively copies the contents of src into dst. -func deriveDeepCopy_21(dst, src map[string]*UlimitsConfig) { +func deriveDeepCopy_21(dst, src []ServiceSecretConfig) { + for src_i, src_value := range src { + func() { + field := new(ServiceSecretConfig) + deriveDeepCopy_42(field, &src_value) + dst[src_i] = *field + }() + } +} + +// deriveDeepCopy_22 recursively copies the contents of src into dst. +func deriveDeepCopy_22(dst, src map[string]*UlimitsConfig) { for src_key, src_value := range src { if src_value == nil { dst[src_key] = nil @@ -1395,27 +1418,16 @@ func deriveDeepCopy_21(dst, src map[string]*UlimitsConfig) { dst[src_key] = nil } else { dst[src_key] = new(UlimitsConfig) - deriveDeepCopy_42(dst[src_key], src_value) + deriveDeepCopy_43(dst[src_key], src_value) } } } -// deriveDeepCopy_22 recursively copies the contents of src into dst. -func deriveDeepCopy_22(dst, src []ServiceVolumeConfig) { +// deriveDeepCopy_23 recursively copies the contents of src into dst. +func deriveDeepCopy_23(dst, src []ServiceVolumeConfig) { for src_i, src_value := range src { func() { field := new(ServiceVolumeConfig) - deriveDeepCopy_43(field, &src_value) - dst[src_i] = *field - }() - } -} - -// deriveDeepCopy_23 recursively copies the contents of src into dst. -func deriveDeepCopy_23(dst, src []ServiceHook) { - for src_i, src_value := range src { - func() { - field := new(ServiceHook) deriveDeepCopy_44(field, &src_value) dst[src_i] = *field }() @@ -1423,7 +1435,18 @@ func deriveDeepCopy_23(dst, src []ServiceHook) { } // deriveDeepCopy_24 recursively copies the contents of src into dst. -func deriveDeepCopy_24(dst, src *NetworkConfig) { +func deriveDeepCopy_24(dst, src []ServiceHook) { + for src_i, src_value := range src { + func() { + field := new(ServiceHook) + deriveDeepCopy_45(field, &src_value) + dst[src_i] = *field + }() + } +} + +// deriveDeepCopy_25 recursively copies the contents of src into dst. +func deriveDeepCopy_25(dst, src *NetworkConfig) { dst.Name = src.Name dst.Driver = src.Driver if src.DriverOpts != nil { @@ -1434,7 +1457,7 @@ func deriveDeepCopy_24(dst, src *NetworkConfig) { } func() { field := new(IPAMConfig) - deriveDeepCopy_45(field, &src.Ipam) + deriveDeepCopy_46(field, &src.Ipam) dst.Ipam = *field }() dst.External = src.External @@ -1472,8 +1495,8 @@ func deriveDeepCopy_24(dst, src *NetworkConfig) { } } -// deriveDeepCopy_25 recursively copies the contents of src into dst. -func deriveDeepCopy_25(dst, src *VolumeConfig) { +// deriveDeepCopy_26 recursively copies the contents of src into dst. +func deriveDeepCopy_26(dst, src *VolumeConfig) { dst.Name = src.Name dst.Driver = src.Driver if src.DriverOpts != nil { @@ -1503,38 +1526,8 @@ func deriveDeepCopy_25(dst, src *VolumeConfig) { } } -// deriveDeepCopy_26 recursively copies the contents of src into dst. -func deriveDeepCopy_26(dst, src *SecretConfig) { - dst.Name = src.Name - dst.File = src.File - dst.Environment = src.Environment - dst.Content = src.Content - dst.marshallContent = src.marshallContent - dst.External = src.External - if src.Labels != nil { - dst.Labels = make(map[string]string, len(src.Labels)) - deriveDeepCopy_4(dst.Labels, src.Labels) - } else { - dst.Labels = nil - } - dst.Driver = src.Driver - if src.DriverOpts != nil { - dst.DriverOpts = make(map[string]string, len(src.DriverOpts)) - deriveDeepCopy_4(dst.DriverOpts, src.DriverOpts) - } else { - dst.DriverOpts = nil - } - dst.TemplateDriver = src.TemplateDriver - if src.Extensions != nil { - dst.Extensions = make(map[string]any, len(src.Extensions)) - src.Extensions.DeepCopy(dst.Extensions) - } else { - dst.Extensions = nil - } -} - // deriveDeepCopy_27 recursively copies the contents of src into dst. -func deriveDeepCopy_27(dst, src *ConfigObjConfig) { +func deriveDeepCopy_27(dst, src *SecretConfig) { dst.Name = src.Name dst.File = src.File dst.Environment = src.Environment @@ -1564,21 +1557,40 @@ func deriveDeepCopy_27(dst, src *ConfigObjConfig) { } // deriveDeepCopy_28 recursively copies the contents of src into dst. -func deriveDeepCopy_28(dst, src []Trigger) { - for src_i, src_value := range src { - func() { - field := new(Trigger) - deriveDeepCopy_46(field, &src_value) - dst[src_i] = *field - }() +func deriveDeepCopy_28(dst, src *ConfigObjConfig) { + dst.Name = src.Name + dst.File = src.File + dst.Environment = src.Environment + dst.Content = src.Content + dst.marshallContent = src.marshallContent + dst.External = src.External + if src.Labels != nil { + dst.Labels = make(map[string]string, len(src.Labels)) + deriveDeepCopy_4(dst.Labels, src.Labels) + } else { + dst.Labels = nil + } + dst.Driver = src.Driver + if src.DriverOpts != nil { + dst.DriverOpts = make(map[string]string, len(src.DriverOpts)) + deriveDeepCopy_4(dst.DriverOpts, src.DriverOpts) + } else { + dst.DriverOpts = nil + } + dst.TemplateDriver = src.TemplateDriver + if src.Extensions != nil { + dst.Extensions = make(map[string]any, len(src.Extensions)) + src.Extensions.DeepCopy(dst.Extensions) + } else { + dst.Extensions = nil } } // deriveDeepCopy_29 recursively copies the contents of src into dst. -func deriveDeepCopy_29(dst, src []WeightDevice) { +func deriveDeepCopy_29(dst, src []Trigger) { for src_i, src_value := range src { func() { - field := new(WeightDevice) + field := new(Trigger) deriveDeepCopy_47(field, &src_value) dst[src_i] = *field }() @@ -1586,10 +1598,10 @@ func deriveDeepCopy_29(dst, src []WeightDevice) { } // deriveDeepCopy_30 recursively copies the contents of src into dst. -func deriveDeepCopy_30(dst, src []ThrottleDevice) { +func deriveDeepCopy_30(dst, src []WeightDevice) { for src_i, src_value := range src { func() { - field := new(ThrottleDevice) + field := new(WeightDevice) deriveDeepCopy_48(field, &src_value) dst[src_i] = *field }() @@ -1597,7 +1609,18 @@ func deriveDeepCopy_30(dst, src []ThrottleDevice) { } // deriveDeepCopy_31 recursively copies the contents of src into dst. -func deriveDeepCopy_31(dst, src *ServiceConfigObjConfig) { +func deriveDeepCopy_31(dst, src []ThrottleDevice) { + for src_i, src_value := range src { + func() { + field := new(ThrottleDevice) + deriveDeepCopy_49(field, &src_value) + dst[src_i] = *field + }() + } +} + +// deriveDeepCopy_32 recursively copies the contents of src into dst. +func deriveDeepCopy_32(dst, src *ServiceConfigObjConfig) { dst.Source = src.Source dst.Target = src.Target dst.UID = src.UID @@ -1616,8 +1639,8 @@ func deriveDeepCopy_31(dst, src *ServiceConfigObjConfig) { } } -// deriveDeepCopy_32 recursively copies the contents of src into dst. -func deriveDeepCopy_32(dst, src *ServiceDependency) { +// deriveDeepCopy_33 recursively copies the contents of src into dst. +func deriveDeepCopy_33(dst, src *ServiceDependency) { dst.Condition = src.Condition dst.Restart = src.Restart if src.Extensions != nil { @@ -1629,8 +1652,8 @@ func deriveDeepCopy_32(dst, src *ServiceDependency) { dst.Required = src.Required } -// deriveDeepCopy_33 recursively copies the contents of src into dst. -func deriveDeepCopy_33(dst, src *UpdateConfig) { +// deriveDeepCopy_34 recursively copies the contents of src into dst. +func deriveDeepCopy_34(dst, src *UpdateConfig) { if src.Parallelism == nil { dst.Parallelism = nil } else { @@ -1650,19 +1673,19 @@ func deriveDeepCopy_33(dst, src *UpdateConfig) { } } -// deriveDeepCopy_34 recursively copies the contents of src into dst. -func deriveDeepCopy_34(dst, src *Resources) { +// deriveDeepCopy_35 recursively copies the contents of src into dst. +func deriveDeepCopy_35(dst, src *Resources) { if src.Limits == nil { dst.Limits = nil } else { dst.Limits = new(Resource) - deriveDeepCopy_49(dst.Limits, src.Limits) + deriveDeepCopy_50(dst.Limits, src.Limits) } if src.Reservations == nil { dst.Reservations = nil } else { dst.Reservations = new(Resource) - deriveDeepCopy_49(dst.Reservations, src.Reservations) + deriveDeepCopy_50(dst.Reservations, src.Reservations) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -1672,8 +1695,8 @@ func deriveDeepCopy_34(dst, src *Resources) { } } -// deriveDeepCopy_35 recursively copies the contents of src into dst. -func deriveDeepCopy_35(dst, src *RestartPolicy) { +// deriveDeepCopy_36 recursively copies the contents of src into dst. +func deriveDeepCopy_36(dst, src *RestartPolicy) { dst.Condition = src.Condition if src.Delay == nil { dst.Delay = nil @@ -1701,8 +1724,8 @@ func deriveDeepCopy_35(dst, src *RestartPolicy) { } } -// deriveDeepCopy_36 recursively copies the contents of src into dst. -func deriveDeepCopy_36(dst, src *Placement) { +// deriveDeepCopy_37 recursively copies the contents of src into dst. +func deriveDeepCopy_37(dst, src *Placement) { if src.Constraints == nil { dst.Constraints = nil } else { @@ -1737,7 +1760,7 @@ func deriveDeepCopy_36(dst, src *Placement) { } else { dst.Preferences = make([]PlacementPreferences, len(src.Preferences)) } - deriveDeepCopy_50(dst.Preferences, src.Preferences) + deriveDeepCopy_51(dst.Preferences, src.Preferences) } dst.MaxReplicas = src.MaxReplicas if src.Extensions != nil { @@ -1748,8 +1771,8 @@ func deriveDeepCopy_36(dst, src *Placement) { } } -// deriveDeepCopy_37 recursively copies the contents of src into dst. -func deriveDeepCopy_37(dst, src *DeviceMapping) { +// deriveDeepCopy_38 recursively copies the contents of src into dst. +func deriveDeepCopy_38(dst, src *DeviceMapping) { dst.Source = src.Source dst.Target = src.Target dst.Permissions = src.Permissions @@ -1761,8 +1784,8 @@ func deriveDeepCopy_37(dst, src *DeviceMapping) { } } -// deriveDeepCopy_38 recursively copies the contents of src into dst. -func deriveDeepCopy_38(dst, src *DeviceRequest) { +// deriveDeepCopy_39 recursively copies the contents of src into dst. +func deriveDeepCopy_39(dst, src *DeviceRequest) { if src.Capabilities == nil { dst.Capabilities = nil } else { @@ -1809,8 +1832,8 @@ func deriveDeepCopy_38(dst, src *DeviceRequest) { } } -// deriveDeepCopy_39 recursively copies the contents of src into dst. -func deriveDeepCopy_39(dst, src *ServiceNetworkConfig) { +// deriveDeepCopy_40 recursively copies the contents of src into dst. +func deriveDeepCopy_40(dst, src *ServiceNetworkConfig) { dst.Priority = src.Priority dst.GatewayPriority = src.GatewayPriority if src.Aliases == nil { @@ -1866,8 +1889,8 @@ func deriveDeepCopy_39(dst, src *ServiceNetworkConfig) { } } -// deriveDeepCopy_40 recursively copies the contents of src into dst. -func deriveDeepCopy_40(dst, src *ServicePortConfig) { +// deriveDeepCopy_41 recursively copies the contents of src into dst. +func deriveDeepCopy_41(dst, src *ServicePortConfig) { dst.Name = src.Name dst.Mode = src.Mode dst.HostIP = src.HostIP @@ -1883,8 +1906,8 @@ func deriveDeepCopy_40(dst, src *ServicePortConfig) { } } -// deriveDeepCopy_41 recursively copies the contents of src into dst. -func deriveDeepCopy_41(dst, src *ServiceSecretConfig) { +// deriveDeepCopy_42 recursively copies the contents of src into dst. +func deriveDeepCopy_42(dst, src *ServiceSecretConfig) { dst.Source = src.Source dst.Target = src.Target dst.UID = src.UID @@ -1903,8 +1926,8 @@ func deriveDeepCopy_41(dst, src *ServiceSecretConfig) { } } -// deriveDeepCopy_42 recursively copies the contents of src into dst. -func deriveDeepCopy_42(dst, src *UlimitsConfig) { +// deriveDeepCopy_43 recursively copies the contents of src into dst. +func deriveDeepCopy_43(dst, src *UlimitsConfig) { dst.Single = src.Single dst.Soft = src.Soft dst.Hard = src.Hard @@ -1916,8 +1939,8 @@ func deriveDeepCopy_42(dst, src *UlimitsConfig) { } } -// deriveDeepCopy_43 recursively copies the contents of src into dst. -func deriveDeepCopy_43(dst, src *ServiceVolumeConfig) { +// deriveDeepCopy_44 recursively copies the contents of src into dst. +func deriveDeepCopy_44(dst, src *ServiceVolumeConfig) { dst.Type = src.Type dst.Source = src.Source dst.Target = src.Target @@ -1927,19 +1950,25 @@ func deriveDeepCopy_43(dst, src *ServiceVolumeConfig) { dst.Bind = nil } else { dst.Bind = new(ServiceVolumeBind) - deriveDeepCopy_51(dst.Bind, src.Bind) + deriveDeepCopy_52(dst.Bind, src.Bind) } if src.Volume == nil { dst.Volume = nil } else { dst.Volume = new(ServiceVolumeVolume) - deriveDeepCopy_52(dst.Volume, src.Volume) + deriveDeepCopy_53(dst.Volume, src.Volume) } if src.Tmpfs == nil { dst.Tmpfs = nil } else { dst.Tmpfs = new(ServiceVolumeTmpfs) - deriveDeepCopy_53(dst.Tmpfs, src.Tmpfs) + deriveDeepCopy_54(dst.Tmpfs, src.Tmpfs) + } + if src.Image == nil { + dst.Image = nil + } else { + dst.Image = new(ServiceVolumeImage) + deriveDeepCopy_55(dst.Image, src.Image) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -1949,8 +1978,8 @@ func deriveDeepCopy_43(dst, src *ServiceVolumeConfig) { } } -// deriveDeepCopy_44 recursively copies the contents of src into dst. -func deriveDeepCopy_44(dst, src *ServiceHook) { +// deriveDeepCopy_45 recursively copies the contents of src into dst. +func deriveDeepCopy_45(dst, src *ServiceHook) { if src.Command == nil { dst.Command = nil } else { @@ -1974,7 +2003,7 @@ func deriveDeepCopy_44(dst, src *ServiceHook) { dst.WorkingDir = src.WorkingDir if src.Environment != nil { dst.Environment = make(map[string]*string, len(src.Environment)) - deriveDeepCopy_13(dst.Environment, src.Environment) + deriveDeepCopy_14(dst.Environment, src.Environment) } else { dst.Environment = nil } @@ -1986,8 +2015,8 @@ func deriveDeepCopy_44(dst, src *ServiceHook) { } } -// deriveDeepCopy_45 recursively copies the contents of src into dst. -func deriveDeepCopy_45(dst, src *IPAMConfig) { +// deriveDeepCopy_46 recursively copies the contents of src into dst. +func deriveDeepCopy_46(dst, src *IPAMConfig) { dst.Driver = src.Driver if src.Config == nil { dst.Config = nil @@ -2005,7 +2034,7 @@ func deriveDeepCopy_45(dst, src *IPAMConfig) { } else { dst.Config = make([]*IPAMPool, len(src.Config)) } - deriveDeepCopy_54(dst.Config, src.Config) + deriveDeepCopy_56(dst.Config, src.Config) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -2015,14 +2044,14 @@ func deriveDeepCopy_45(dst, src *IPAMConfig) { } } -// deriveDeepCopy_46 recursively copies the contents of src into dst. -func deriveDeepCopy_46(dst, src *Trigger) { +// deriveDeepCopy_47 recursively copies the contents of src into dst. +func deriveDeepCopy_47(dst, src *Trigger) { dst.Path = src.Path dst.Action = src.Action dst.Target = src.Target func() { field := new(ServiceHook) - deriveDeepCopy_44(field, &src.Exec) + deriveDeepCopy_45(field, &src.Exec) dst.Exec = *field }() if src.Include == nil { @@ -2069,8 +2098,8 @@ func deriveDeepCopy_46(dst, src *Trigger) { } } -// deriveDeepCopy_47 recursively copies the contents of src into dst. -func deriveDeepCopy_47(dst, src *WeightDevice) { +// deriveDeepCopy_48 recursively copies the contents of src into dst. +func deriveDeepCopy_48(dst, src *WeightDevice) { dst.Path = src.Path dst.Weight = src.Weight if src.Extensions != nil { @@ -2081,8 +2110,8 @@ func deriveDeepCopy_47(dst, src *WeightDevice) { } } -// deriveDeepCopy_48 recursively copies the contents of src into dst. -func deriveDeepCopy_48(dst, src *ThrottleDevice) { +// deriveDeepCopy_49 recursively copies the contents of src into dst. +func deriveDeepCopy_49(dst, src *ThrottleDevice) { dst.Path = src.Path dst.Rate = src.Rate if src.Extensions != nil { @@ -2093,8 +2122,8 @@ func deriveDeepCopy_48(dst, src *ThrottleDevice) { } } -// deriveDeepCopy_49 recursively copies the contents of src into dst. -func deriveDeepCopy_49(dst, src *Resource) { +// deriveDeepCopy_50 recursively copies the contents of src into dst. +func deriveDeepCopy_50(dst, src *Resource) { dst.NanoCPUs = src.NanoCPUs dst.MemoryBytes = src.MemoryBytes dst.Pids = src.Pids @@ -2114,7 +2143,7 @@ func deriveDeepCopy_49(dst, src *Resource) { } else { dst.Devices = make([]DeviceRequest, len(src.Devices)) } - deriveDeepCopy_15(dst.Devices, src.Devices) + deriveDeepCopy_16(dst.Devices, src.Devices) } if src.GenericResources == nil { dst.GenericResources = nil @@ -2132,7 +2161,7 @@ func deriveDeepCopy_49(dst, src *Resource) { } else { dst.GenericResources = make([]GenericResource, len(src.GenericResources)) } - deriveDeepCopy_55(dst.GenericResources, src.GenericResources) + deriveDeepCopy_57(dst.GenericResources, src.GenericResources) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -2142,19 +2171,19 @@ func deriveDeepCopy_49(dst, src *Resource) { } } -// deriveDeepCopy_50 recursively copies the contents of src into dst. -func deriveDeepCopy_50(dst, src []PlacementPreferences) { +// deriveDeepCopy_51 recursively copies the contents of src into dst. +func deriveDeepCopy_51(dst, src []PlacementPreferences) { for src_i, src_value := range src { func() { field := new(PlacementPreferences) - deriveDeepCopy_56(field, &src_value) + deriveDeepCopy_58(field, &src_value) dst[src_i] = *field }() } } -// deriveDeepCopy_51 recursively copies the contents of src into dst. -func deriveDeepCopy_51(dst, src *ServiceVolumeBind) { +// deriveDeepCopy_52 recursively copies the contents of src into dst. +func deriveDeepCopy_52(dst, src *ServiceVolumeBind) { dst.SELinux = src.SELinux dst.Propagation = src.Propagation dst.CreateHostPath = src.CreateHostPath @@ -2167,8 +2196,14 @@ func deriveDeepCopy_51(dst, src *ServiceVolumeBind) { } } -// deriveDeepCopy_52 recursively copies the contents of src into dst. -func deriveDeepCopy_52(dst, src *ServiceVolumeVolume) { +// deriveDeepCopy_53 recursively copies the contents of src into dst. +func deriveDeepCopy_53(dst, src *ServiceVolumeVolume) { + if src.Labels != nil { + dst.Labels = make(map[string]string, len(src.Labels)) + deriveDeepCopy_4(dst.Labels, src.Labels) + } else { + dst.Labels = nil + } dst.NoCopy = src.NoCopy dst.Subpath = src.Subpath if src.Extensions != nil { @@ -2179,8 +2214,8 @@ func deriveDeepCopy_52(dst, src *ServiceVolumeVolume) { } } -// deriveDeepCopy_53 recursively copies the contents of src into dst. -func deriveDeepCopy_53(dst, src *ServiceVolumeTmpfs) { +// deriveDeepCopy_54 recursively copies the contents of src into dst. +func deriveDeepCopy_54(dst, src *ServiceVolumeTmpfs) { dst.Size = src.Size dst.Mode = src.Mode if src.Extensions != nil { @@ -2191,31 +2226,42 @@ func deriveDeepCopy_53(dst, src *ServiceVolumeTmpfs) { } } -// deriveDeepCopy_54 recursively copies the contents of src into dst. -func deriveDeepCopy_54(dst, src []*IPAMPool) { +// deriveDeepCopy_55 recursively copies the contents of src into dst. +func deriveDeepCopy_55(dst, src *ServiceVolumeImage) { + dst.SubPath = src.SubPath + if src.Extensions != nil { + dst.Extensions = make(map[string]any, len(src.Extensions)) + src.Extensions.DeepCopy(dst.Extensions) + } else { + dst.Extensions = nil + } +} + +// deriveDeepCopy_56 recursively copies the contents of src into dst. +func deriveDeepCopy_56(dst, src []*IPAMPool) { for src_i, src_value := range src { if src_value == nil { dst[src_i] = nil } else { dst[src_i] = new(IPAMPool) - deriveDeepCopy_57(dst[src_i], src_value) + deriveDeepCopy_59(dst[src_i], src_value) } } } -// deriveDeepCopy_55 recursively copies the contents of src into dst. -func deriveDeepCopy_55(dst, src []GenericResource) { +// deriveDeepCopy_57 recursively copies the contents of src into dst. +func deriveDeepCopy_57(dst, src []GenericResource) { for src_i, src_value := range src { func() { field := new(GenericResource) - deriveDeepCopy_58(field, &src_value) + deriveDeepCopy_60(field, &src_value) dst[src_i] = *field }() } } -// deriveDeepCopy_56 recursively copies the contents of src into dst. -func deriveDeepCopy_56(dst, src *PlacementPreferences) { +// deriveDeepCopy_58 recursively copies the contents of src into dst. +func deriveDeepCopy_58(dst, src *PlacementPreferences) { dst.Spread = src.Spread if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -2225,8 +2271,8 @@ func deriveDeepCopy_56(dst, src *PlacementPreferences) { } } -// deriveDeepCopy_57 recursively copies the contents of src into dst. -func deriveDeepCopy_57(dst, src *IPAMPool) { +// deriveDeepCopy_59 recursively copies the contents of src into dst. +func deriveDeepCopy_59(dst, src *IPAMPool) { dst.Subnet = src.Subnet dst.Gateway = src.Gateway dst.IPRange = src.IPRange @@ -2244,13 +2290,13 @@ func deriveDeepCopy_57(dst, src *IPAMPool) { } } -// deriveDeepCopy_58 recursively copies the contents of src into dst. -func deriveDeepCopy_58(dst, src *GenericResource) { +// deriveDeepCopy_60 recursively copies the contents of src into dst. +func deriveDeepCopy_60(dst, src *GenericResource) { if src.DiscreteResourceSpec == nil { dst.DiscreteResourceSpec = nil } else { dst.DiscreteResourceSpec = new(DiscreteGenericResource) - deriveDeepCopy_59(dst.DiscreteResourceSpec, src.DiscreteResourceSpec) + deriveDeepCopy_61(dst.DiscreteResourceSpec, src.DiscreteResourceSpec) } if src.Extensions != nil { dst.Extensions = make(map[string]any, len(src.Extensions)) @@ -2260,8 +2306,8 @@ func deriveDeepCopy_58(dst, src *GenericResource) { } } -// deriveDeepCopy_59 recursively copies the contents of src into dst. -func deriveDeepCopy_59(dst, src *DiscreteGenericResource) { +// deriveDeepCopy_61 recursively copies the contents of src into dst. +func deriveDeepCopy_61(dst, src *DiscreteGenericResource) { dst.Kind = src.Kind dst.Value = src.Value if src.Extensions != nil { diff --git a/vendor/github.com/compose-spec/compose-go/v2/types/project.go b/vendor/github.com/compose-spec/compose-go/v2/types/project.go index e28554ab..973874dd 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/types/project.go +++ b/vendor/github.com/compose-spec/compose-go/v2/types/project.go @@ -21,8 +21,10 @@ import ( "context" "encoding/json" "fmt" + "maps" "os" "path/filepath" + "slices" "sort" "github.com/compose-spec/compose-go/v2/dotenv" @@ -30,7 +32,6 @@ import ( "github.com/compose-spec/compose-go/v2/utils" "github.com/distribution/reference" godigest "github.com/opencontainers/go-digest" - "golang.org/x/exp/maps" "golang.org/x/sync/errgroup" "gopkg.in/yaml.v3" ) @@ -120,21 +121,21 @@ func (p *Project) ServicesWithBuild() []string { servicesBuild := p.Services.Filter(func(s ServiceConfig) bool { return s.Build != nil && s.Build.Context != "" }) - return maps.Keys(servicesBuild) + return slices.Collect(maps.Keys(servicesBuild)) } func (p *Project) ServicesWithExtends() []string { servicesExtends := p.Services.Filter(func(s ServiceConfig) bool { return s.Extends != nil && *s.Extends != (ExtendsConfig{}) }) - return maps.Keys(servicesExtends) + return slices.Collect(maps.Keys(servicesExtends)) } func (p *Project) ServicesWithDependsOn() []string { servicesDependsOn := p.Services.Filter(func(s ServiceConfig) bool { return len(s.DependsOn) > 0 }) - return maps.Keys(servicesDependsOn) + return slices.Collect(maps.Keys(servicesDependsOn)) } func (p *Project) ServicesWithCapabilities() ([]string, []string, []string) { @@ -156,9 +157,10 @@ func (p *Project) ServicesWithCapabilities() ([]string, []string, []string) { capabilities = append(capabilities, service.Name) } for _, c := range d.Capabilities { - if c == "gpu" { + switch c { + case "gpu": gpu = append(gpu, service.Name) - } else if c == "tpu" { + case "tpu": tpu = append(tpu, service.Name) } } @@ -188,16 +190,25 @@ func (p *Project) getServicesByNames(names ...string) (Services, []string) { if len(names) == 0 { return p.Services, nil } + services := Services{} var servicesNotFound []string for _, name := range names { - service, ok := p.Services[name] - if !ok { - servicesNotFound = append(servicesNotFound, name) - continue + matched := false + + for serviceName, service := range p.Services { + match, _ := filepath.Match(name, serviceName) + if match { + services[serviceName] = service + matched = true + } + } + + if !matched { + servicesNotFound = append(servicesNotFound, name) } - services[name] = service } + return services, servicesNotFound } @@ -298,16 +309,25 @@ func (p *Project) withServices(names []string, fn ServiceFunc, seen map[string]b return nil } -func (p *Project) GetDependentsForService(s ServiceConfig) []string { - return utils.MapKeys(p.dependentsForService(s)) +func (p *Project) GetDependentsForService(s ServiceConfig, filter ...func(ServiceDependency) bool) []string { + return utils.MapKeys(p.dependentsForService(s, filter...)) } -func (p *Project) dependentsForService(s ServiceConfig) map[string]ServiceDependency { +func (p *Project) dependentsForService(s ServiceConfig, filter ...func(ServiceDependency) bool) map[string]ServiceDependency { dependent := make(map[string]ServiceDependency) for _, service := range p.Services { for name, dependency := range service.DependsOn { if name == s.Name { - dependent[service.Name] = dependency + depends := true + for _, f := range filter { + if !f(dependency) { + depends = false + break + } + } + if depends { + dependent[service.Name] = dependency + } } } } @@ -630,25 +650,25 @@ func (p Project) WithServicesEnvironmentResolved(discardEnvFiles bool) (*Project for i, service := range newProject.Services { service.Environment = service.Environment.Resolve(newProject.Environment.Resolve) - environment := MappingWithEquals{} - // resolve variables based on other files we already parsed, + project's environment - var resolve dotenv.LookupFn = func(s string) (string, bool) { - v, ok := environment[s] - if ok && v != nil { - return *v, ok - } - return newProject.Environment.Resolve(s) - } - + environment := service.Environment.ToMapping() for _, envFile := range service.EnvFiles { - vars, err := loadEnvFile(envFile, resolve) + err := loadEnvFile(envFile, environment, func(k string) (string, bool) { + // project.env has precedence doing interpolation + if resolve, ok := p.Environment.Resolve(k); ok { + return resolve, true + } + // then service.environment + if s, ok := service.Environment[k]; ok { + return *s, true + } + return "", false + }) if err != nil { return nil, err } - environment.OverrideBy(vars.ToMappingWithEquals()) } - service.Environment = environment.OverrideBy(service.Environment) + service.Environment = environment.ToMappingWithEquals().OverrideBy(service.Environment) if discardEnvFiles { service.EnvFiles = nil @@ -696,15 +716,16 @@ func (p Project) WithServicesLabelsResolved(discardLabelFiles bool) (*Project, e return newProject, nil } -func loadEnvFile(envFile EnvFile, resolve dotenv.LookupFn) (Mapping, error) { +func loadEnvFile(envFile EnvFile, environment Mapping, resolve dotenv.LookupFn) error { if _, err := os.Stat(envFile.Path); os.IsNotExist(err) { if envFile.Required { - return nil, fmt.Errorf("env file %s not found: %w", envFile.Path, err) + return fmt.Errorf("env file %s not found: %w", envFile.Path, err) } - return nil, nil + return nil } - return loadMappingFile(envFile.Path, envFile.Format, resolve) + err := loadMappingFile(envFile.Path, envFile.Format, environment, resolve) + return err } func loadLabelFile(labelFile string, resolve dotenv.LookupFn) (Mapping, error) { @@ -712,21 +733,19 @@ func loadLabelFile(labelFile string, resolve dotenv.LookupFn) (Mapping, error) { return nil, fmt.Errorf("label file %s not found: %w", labelFile, err) } - return loadMappingFile(labelFile, "", resolve) + labels := Mapping{} + err := loadMappingFile(labelFile, "", labels, resolve) + return labels, err } -func loadMappingFile(path string, format string, resolve dotenv.LookupFn) (Mapping, error) { +func loadMappingFile(path string, format string, vars Mapping, resolve dotenv.LookupFn) error { file, err := os.Open(path) if err != nil { - return nil, err + return err } defer file.Close() - fileVars, err := dotenv.ParseWithFormat(file, path, resolve, format) - if err != nil { - return nil, err - } - return fileVars, nil + return dotenv.ParseWithFormat(file, path, vars, resolve, format) } func (p *Project) deepCopy() *Project { diff --git a/vendor/github.com/compose-spec/compose-go/v2/types/types.go b/vendor/github.com/compose-spec/compose-go/v2/types/types.go index fe95444d..acfb3559 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/types/types.go +++ b/vendor/github.com/compose-spec/compose-go/v2/types/types.go @@ -75,8 +75,8 @@ type ServiceConfig struct { // If set, overrides ENTRYPOINT from the image. // // Set to `[]` or an empty string to clear the entrypoint from the image. - Entrypoint ShellCommand `yaml:"entrypoint,omitempty" json:"entrypoint"` // NOTE: we can NOT omitempty for JSON! see ShellCommand type for details. - + Entrypoint ShellCommand `yaml:"entrypoint,omitempty" json:"entrypoint"` // NOTE: we can NOT omitempty for JSON! see ShellCommand type for details. + Provider *ServiceProviderConfig `yaml:"provider,omitempty" json:"provider,omitempty"` Environment MappingWithEquals `yaml:"environment,omitempty" json:"environment,omitempty"` EnvFiles []EnvFile `yaml:"env_file,omitempty" json:"env_file,omitempty"` Expose StringOrNumberList `yaml:"expose,omitempty" json:"expose,omitempty"` @@ -142,6 +142,12 @@ type ServiceConfig struct { Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"` } +type ServiceProviderConfig struct { + Type string `yaml:"type,omitempty" json:"driver,omitempty"` + Options Options `yaml:"options,omitempty" json:"options,omitempty"` + Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"` +} + // MarshalYAML makes ServiceConfig implement yaml.Marshaller func (s ServiceConfig) MarshalYAML() (interface{}, error) { type t ServiceConfig @@ -535,6 +541,7 @@ type ServiceVolumeConfig struct { Bind *ServiceVolumeBind `yaml:"bind,omitempty" json:"bind,omitempty"` Volume *ServiceVolumeVolume `yaml:"volume,omitempty" json:"volume,omitempty"` Tmpfs *ServiceVolumeTmpfs `yaml:"tmpfs,omitempty" json:"tmpfs,omitempty"` + Image *ServiceVolumeImage `yaml:"image,omitempty" json:"image,omitempty"` Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"` } @@ -569,6 +576,8 @@ const ( VolumeTypeNamedPipe = "npipe" // VolumeTypeCluster is the type for mounting container storage interface (CSI) volumes VolumeTypeCluster = "cluster" + // VolumeTypeImage is the tpe for mounting an image + VolumeTypeImage = "image" // SElinuxShared share the volume content SElinuxShared = "z" @@ -612,8 +621,9 @@ const ( // ServiceVolumeVolume are options for a service volume of type volume type ServiceVolumeVolume struct { - NoCopy bool `yaml:"nocopy,omitempty" json:"nocopy,omitempty"` - Subpath string `yaml:"subpath,omitempty" json:"subpath,omitempty"` + Labels Mapping `yaml:"labels,omitempty" json:"labels,omitempty"` + NoCopy bool `yaml:"nocopy,omitempty" json:"nocopy,omitempty"` + Subpath string `yaml:"subpath,omitempty" json:"subpath,omitempty"` Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"` } @@ -627,6 +637,11 @@ type ServiceVolumeTmpfs struct { Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"` } +type ServiceVolumeImage struct { + SubPath string `yaml:"subpath,omitempty" json:"subpath,omitempty"` + Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"` +} + type FileMode int64 // FileReferenceConfig for a reference to a swarm file object diff --git a/vendor/github.com/compose-spec/compose-go/v2/utils/collectionutils.go b/vendor/github.com/compose-spec/compose-go/v2/utils/collectionutils.go index 4df8fb1f..ed815f0f 100644 --- a/vendor/github.com/compose-spec/compose-go/v2/utils/collectionutils.go +++ b/vendor/github.com/compose-spec/compose-go/v2/utils/collectionutils.go @@ -17,15 +17,13 @@ package utils import ( - "golang.org/x/exp/constraints" - "golang.org/x/exp/maps" - "golang.org/x/exp/slices" + "cmp" + "maps" + "slices" ) -func MapKeys[T constraints.Ordered, U any](theMap map[T]U) []T { - result := maps.Keys(theMap) - slices.Sort(result) - return result +func MapKeys[T cmp.Ordered, U any](theMap map[T]U) []T { + return slices.Sorted(maps.Keys(theMap)) } func MapsAppend[T comparable, U any](target map[T]U, source map[T]U) map[T]U { diff --git a/vendor/golang.org/x/exp/LICENSE b/vendor/golang.org/x/exp/LICENSE deleted file mode 100644 index 2a7cf70d..00000000 --- a/vendor/golang.org/x/exp/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2009 The Go Authors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/exp/PATENTS b/vendor/golang.org/x/exp/PATENTS deleted file mode 100644 index 73309904..00000000 --- a/vendor/golang.org/x/exp/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/exp/constraints/constraints.go b/vendor/golang.org/x/exp/constraints/constraints.go deleted file mode 100644 index 9d260bab..00000000 --- a/vendor/golang.org/x/exp/constraints/constraints.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package constraints defines a set of useful constraints to be used -// with type parameters. -package constraints - -import "cmp" - -// Signed is a constraint that permits any signed integer type. -// If future releases of Go add new predeclared signed integer types, -// this constraint will be modified to include them. -type Signed interface { - ~int | ~int8 | ~int16 | ~int32 | ~int64 -} - -// Unsigned is a constraint that permits any unsigned integer type. -// If future releases of Go add new predeclared unsigned integer types, -// this constraint will be modified to include them. -type Unsigned interface { - ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr -} - -// Integer is a constraint that permits any integer type. -// If future releases of Go add new predeclared integer types, -// this constraint will be modified to include them. -type Integer interface { - Signed | Unsigned -} - -// Float is a constraint that permits any floating-point type. -// If future releases of Go add new predeclared floating-point types, -// this constraint will be modified to include them. -type Float interface { - ~float32 | ~float64 -} - -// Complex is a constraint that permits any complex numeric type. -// If future releases of Go add new predeclared complex numeric types, -// this constraint will be modified to include them. -type Complex interface { - ~complex64 | ~complex128 -} - -// Ordered is a constraint that permits any ordered type: any type -// that supports the operators < <= >= >. -// If future releases of Go add new ordered types, -// this constraint will be modified to include them. -// -// This type is redundant since Go 1.21 introduced [cmp.Ordered]. -// -//go:fix inline -type Ordered = cmp.Ordered diff --git a/vendor/golang.org/x/exp/maps/maps.go b/vendor/golang.org/x/exp/maps/maps.go deleted file mode 100644 index 4a9747ef..00000000 --- a/vendor/golang.org/x/exp/maps/maps.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package maps defines various functions useful with maps of any type. -package maps - -import "maps" - -// Keys returns the keys of the map m. -// The keys will be in an indeterminate order. -// -// The simplest true equivalent using the standard library is: -// -// slices.AppendSeq(make([]K, 0, len(m)), maps.Keys(m)) -func Keys[M ~map[K]V, K comparable, V any](m M) []K { - - r := make([]K, 0, len(m)) - for k := range m { - r = append(r, k) - } - return r -} - -// Values returns the values of the map m. -// The values will be in an indeterminate order. -// -// The simplest true equivalent using the standard library is: -// -// slices.AppendSeq(make([]V, 0, len(m)), maps.Values(m)) -func Values[M ~map[K]V, K comparable, V any](m M) []V { - - r := make([]V, 0, len(m)) - for _, v := range m { - r = append(r, v) - } - return r -} - -// Equal reports whether two maps contain the same key/value pairs. -// Values are compared using ==. -// -//go:fix inline -func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool { - return maps.Equal(m1, m2) -} - -// EqualFunc is like Equal, but compares values using eq. -// Keys are still compared with ==. -// -//go:fix inline -func EqualFunc[M1 ~map[K]V1, M2 ~map[K]V2, K comparable, V1, V2 any](m1 M1, m2 M2, eq func(V1, V2) bool) bool { - return maps.EqualFunc(m1, m2, eq) -} - -// Clear removes all entries from m, leaving it empty. -// -//go:fix inline -func Clear[M ~map[K]V, K comparable, V any](m M) { - clear(m) -} - -// Clone returns a copy of m. This is a shallow clone: -// the new keys and values are set using ordinary assignment. -// -//go:fix inline -func Clone[M ~map[K]V, K comparable, V any](m M) M { - return maps.Clone(m) -} - -// Copy copies all key/value pairs in src adding them to dst. -// When a key in src is already present in dst, -// the value in dst will be overwritten by the value associated -// with the key in src. -// -//go:fix inline -func Copy[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2) { - maps.Copy(dst, src) -} - -// DeleteFunc deletes any key/value pairs from m for which del returns true. -// -//go:fix inline -func DeleteFunc[M ~map[K]V, K comparable, V any](m M, del func(K, V) bool) { - maps.DeleteFunc(m, del) -} diff --git a/vendor/golang.org/x/exp/slices/slices.go b/vendor/golang.org/x/exp/slices/slices.go deleted file mode 100644 index da0df370..00000000 --- a/vendor/golang.org/x/exp/slices/slices.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package slices defines various functions useful with slices of any type. -package slices - -import ( - "cmp" - "slices" -) - -// Equal reports whether two slices are equal: the same length and all -// elements equal. If the lengths are different, Equal returns false. -// Otherwise, the elements are compared in increasing index order, and the -// comparison stops at the first unequal pair. -// Floating point NaNs are not considered equal. -// -//go:fix inline -func Equal[S ~[]E, E comparable](s1, s2 S) bool { - return slices.Equal(s1, s2) -} - -// EqualFunc reports whether two slices are equal using an equality -// function on each pair of elements. If the lengths are different, -// EqualFunc returns false. Otherwise, the elements are compared in -// increasing index order, and the comparison stops at the first index -// for which eq returns false. -// -//go:fix inline -func EqualFunc[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, eq func(E1, E2) bool) bool { - return slices.EqualFunc(s1, s2, eq) -} - -// Compare compares the elements of s1 and s2, using [cmp.Compare] on each pair -// of elements. The elements are compared sequentially, starting at index 0, -// until one element is not equal to the other. -// The result of comparing the first non-matching elements is returned. -// If both slices are equal until one of them ends, the shorter slice is -// considered less than the longer one. -// The result is 0 if s1 == s2, -1 if s1 < s2, and +1 if s1 > s2. -// -//go:fix inline -func Compare[S ~[]E, E cmp.Ordered](s1, s2 S) int { - return slices.Compare(s1, s2) -} - -// CompareFunc is like [Compare] but uses a custom comparison function on each -// pair of elements. -// The result is the first non-zero result of cmp; if cmp always -// returns 0 the result is 0 if len(s1) == len(s2), -1 if len(s1) < len(s2), -// and +1 if len(s1) > len(s2). -// -//go:fix inline -func CompareFunc[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, cmp func(E1, E2) int) int { - return slices.CompareFunc(s1, s2, cmp) -} - -// Index returns the index of the first occurrence of v in s, -// or -1 if not present. -// -//go:fix inline -func Index[S ~[]E, E comparable](s S, v E) int { - return slices.Index(s, v) -} - -// IndexFunc returns the first index i satisfying f(s[i]), -// or -1 if none do. -// -//go:fix inline -func IndexFunc[S ~[]E, E any](s S, f func(E) bool) int { - return slices.IndexFunc(s, f) -} - -// Contains reports whether v is present in s. -// -//go:fix inline -func Contains[S ~[]E, E comparable](s S, v E) bool { - return slices.Contains(s, v) -} - -// ContainsFunc reports whether at least one -// element e of s satisfies f(e). -// -//go:fix inline -func ContainsFunc[S ~[]E, E any](s S, f func(E) bool) bool { - return slices.ContainsFunc(s, f) -} - -// Insert inserts the values v... into s at index i, -// returning the modified slice. -// The elements at s[i:] are shifted up to make room. -// In the returned slice r, r[i] == v[0], -// and r[i+len(v)] == value originally at r[i]. -// Insert panics if i is out of range. -// This function is O(len(s) + len(v)). -// -//go:fix inline -func Insert[S ~[]E, E any](s S, i int, v ...E) S { - return slices.Insert(s, i, v...) -} - -// Delete removes the elements s[i:j] from s, returning the modified slice. -// Delete panics if j > len(s) or s[i:j] is not a valid slice of s. -// Delete is O(len(s)-i), so if many items must be deleted, it is better to -// make a single call deleting them all together than to delete one at a time. -// Delete zeroes the elements s[len(s)-(j-i):len(s)]. -// -//go:fix inline -func Delete[S ~[]E, E any](s S, i, j int) S { - return slices.Delete(s, i, j) -} - -// DeleteFunc removes any elements from s for which del returns true, -// returning the modified slice. -// DeleteFunc zeroes the elements between the new length and the original length. -// -//go:fix inline -func DeleteFunc[S ~[]E, E any](s S, del func(E) bool) S { - return slices.DeleteFunc(s, del) -} - -// Replace replaces the elements s[i:j] by the given v, and returns the -// modified slice. Replace panics if s[i:j] is not a valid slice of s. -// When len(v) < (j-i), Replace zeroes the elements between the new length and the original length. -// -//go:fix inline -func Replace[S ~[]E, E any](s S, i, j int, v ...E) S { - return slices.Replace(s, i, j, v...) -} - -// Clone returns a copy of the slice. -// The elements are copied using assignment, so this is a shallow clone. -// -//go:fix inline -func Clone[S ~[]E, E any](s S) S { - return slices.Clone(s) -} - -// Compact replaces consecutive runs of equal elements with a single copy. -// This is like the uniq command found on Unix. -// Compact modifies the contents of the slice s and returns the modified slice, -// which may have a smaller length. -// Compact zeroes the elements between the new length and the original length. -// -//go:fix inline -func Compact[S ~[]E, E comparable](s S) S { - return slices.Compact(s) -} - -// CompactFunc is like [Compact] but uses an equality function to compare elements. -// For runs of elements that compare equal, CompactFunc keeps the first one. -// CompactFunc zeroes the elements between the new length and the original length. -// -//go:fix inline -func CompactFunc[S ~[]E, E any](s S, eq func(E, E) bool) S { - return slices.CompactFunc(s, eq) -} - -// Grow increases the slice's capacity, if necessary, to guarantee space for -// another n elements. After Grow(n), at least n elements can be appended -// to the slice without another allocation. If n is negative or too large to -// allocate the memory, Grow panics. -// -//go:fix inline -func Grow[S ~[]E, E any](s S, n int) S { - return slices.Grow(s, n) -} - -// Clip removes unused capacity from the slice, returning s[:len(s):len(s)]. -// -//go:fix inline -func Clip[S ~[]E, E any](s S) S { - return slices.Clip(s) -} - -// Reverse reverses the elements of the slice in place. -// -//go:fix inline -func Reverse[S ~[]E, E any](s S) { - slices.Reverse(s) -} diff --git a/vendor/golang.org/x/exp/slices/sort.go b/vendor/golang.org/x/exp/slices/sort.go deleted file mode 100644 index bd91a8d4..00000000 --- a/vendor/golang.org/x/exp/slices/sort.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package slices - -import ( - "cmp" - "slices" -) - -// Sort sorts a slice of any ordered type in ascending order. -// When sorting floating-point numbers, NaNs are ordered before other values. -// -//go:fix inline -func Sort[S ~[]E, E cmp.Ordered](x S) { - slices.Sort(x) -} - -// SortFunc sorts the slice x in ascending order as determined by the cmp -// function. This sort is not guaranteed to be stable. -// cmp(a, b) should return a negative number when a < b, a positive number when -// a > b and zero when a == b or when a is not comparable to b in the sense -// of the formal definition of Strict Weak Ordering. -// -// SortFunc requires that cmp is a strict weak ordering. -// See https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings. -// To indicate 'uncomparable', return 0 from the function. -// -//go:fix inline -func SortFunc[S ~[]E, E any](x S, cmp func(a, b E) int) { - slices.SortFunc(x, cmp) -} - -// SortStableFunc sorts the slice x while keeping the original order of equal -// elements, using cmp to compare elements in the same way as [SortFunc]. -// -//go:fix inline -func SortStableFunc[S ~[]E, E any](x S, cmp func(a, b E) int) { - slices.SortStableFunc(x, cmp) -} - -// IsSorted reports whether x is sorted in ascending order. -// -//go:fix inline -func IsSorted[S ~[]E, E cmp.Ordered](x S) bool { - return slices.IsSorted(x) -} - -// IsSortedFunc reports whether x is sorted in ascending order, with cmp as the -// comparison function as defined by [SortFunc]. -// -//go:fix inline -func IsSortedFunc[S ~[]E, E any](x S, cmp func(a, b E) int) bool { - return slices.IsSortedFunc(x, cmp) -} - -// Min returns the minimal value in x. It panics if x is empty. -// For floating-point numbers, Min propagates NaNs (any NaN value in x -// forces the output to be NaN). -// -//go:fix inline -func Min[S ~[]E, E cmp.Ordered](x S) E { - return slices.Min(x) -} - -// MinFunc returns the minimal value in x, using cmp to compare elements. -// It panics if x is empty. If there is more than one minimal element -// according to the cmp function, MinFunc returns the first one. -// -//go:fix inline -func MinFunc[S ~[]E, E any](x S, cmp func(a, b E) int) E { - return slices.MinFunc(x, cmp) -} - -// Max returns the maximal value in x. It panics if x is empty. -// For floating-point E, Max propagates NaNs (any NaN value in x -// forces the output to be NaN). -// -//go:fix inline -func Max[S ~[]E, E cmp.Ordered](x S) E { - return slices.Max(x) -} - -// MaxFunc returns the maximal value in x, using cmp to compare elements. -// It panics if x is empty. If there is more than one maximal element -// according to the cmp function, MaxFunc returns the first one. -// -//go:fix inline -func MaxFunc[S ~[]E, E any](x S, cmp func(a, b E) int) E { - return slices.MaxFunc(x, cmp) -} - -// BinarySearch searches for target in a sorted slice and returns the position -// where target is found, or the position where target would appear in the -// sort order; it also returns a bool saying whether the target is really found -// in the slice. The slice must be sorted in increasing order. -// -//go:fix inline -func BinarySearch[S ~[]E, E cmp.Ordered](x S, target E) (int, bool) { - return slices.BinarySearch(x, target) -} - -// BinarySearchFunc works like [BinarySearch], but uses a custom comparison -// function. The slice must be sorted in increasing order, where "increasing" -// is defined by cmp. cmp should return 0 if the slice element matches -// the target, a negative number if the slice element precedes the target, -// or a positive number if the slice element follows the target. -// cmp must implement the same ordering as the slice, such that if -// cmp(a, t) < 0 and cmp(b, t) >= 0, then a must precede b in the slice. -// -//go:fix inline -func BinarySearchFunc[S ~[]E, E, T any](x S, target T, cmp func(E, T) int) (int, bool) { - return slices.BinarySearchFunc(x, target, cmp) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index e71e670c..36dd1f49 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -128,7 +128,7 @@ github.com/cenkalti/backoff/v4 # github.com/cespare/xxhash/v2 v2.3.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 -# github.com/compose-spec/compose-go/v2 v2.4.9 +# github.com/compose-spec/compose-go/v2 v2.6.0 ## explicit; go 1.23 github.com/compose-spec/compose-go/v2/cli github.com/compose-spec/compose-go/v2/consts @@ -859,11 +859,6 @@ golang.org/x/crypto/nacl/sign golang.org/x/crypto/ssh golang.org/x/crypto/ssh/agent golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 -## explicit; go 1.23.0 -golang.org/x/exp/constraints -golang.org/x/exp/maps -golang.org/x/exp/slices # golang.org/x/mod v0.24.0 ## explicit; go 1.23.0 golang.org/x/mod/internal/lazyregexp