Merge pull request #3494 from glours/bump-compose-go-v2.9.1
bump compose-go to version v2.9.1
This commit is contained in:
@@ -6,7 +6,7 @@ require (
|
||||
github.com/Masterminds/semver/v3 v3.4.0
|
||||
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.9.0
|
||||
github.com/compose-spec/compose-go/v2 v2.9.1
|
||||
github.com/containerd/console v1.0.5
|
||||
github.com/containerd/containerd/v2 v2.1.4
|
||||
github.com/containerd/continuity v0.4.5
|
||||
|
||||
@@ -62,8 +62,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.9.0 h1:UHSv/QHlo6QJtrT4igF1rdORgIUhDo1gWuyJUoiNNIM=
|
||||
github.com/compose-spec/compose-go/v2 v2.9.0/go.mod h1:Oky9AZGTRB4E+0VbTPZTUu4Kp+oEMMuwZXZtPPVT1iE=
|
||||
github.com/compose-spec/compose-go/v2 v2.9.1 h1:8UwI+ujNU+9Ffkf/YgAm/qM9/eU7Jn8nHzWG721W4rs=
|
||||
github.com/compose-spec/compose-go/v2 v2.9.1/go.mod h1:Oky9AZGTRB4E+0VbTPZTUu4Kp+oEMMuwZXZtPPVT1iE=
|
||||
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.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/qqsc=
|
||||
|
||||
+17
-2
@@ -42,11 +42,26 @@ func ParseVolume(spec string) (types.ServiceVolumeConfig, error) {
|
||||
}
|
||||
|
||||
var buffer []rune
|
||||
for _, char := range spec + string(endOfSpec) {
|
||||
var inVarSubstitution int // Track nesting depth of ${...}
|
||||
for i, char := range spec + string(endOfSpec) {
|
||||
// Check if we're entering a variable substitution
|
||||
if char == '$' && i+1 < len(spec) && rune(spec[i+1]) == '{' {
|
||||
inVarSubstitution++
|
||||
buffer = append(buffer, char)
|
||||
continue
|
||||
}
|
||||
|
||||
// Check if we're exiting a variable substitution
|
||||
if char == '}' && inVarSubstitution > 0 {
|
||||
inVarSubstitution--
|
||||
buffer = append(buffer, char)
|
||||
continue
|
||||
}
|
||||
|
||||
switch {
|
||||
case isWindowsDrive(buffer, char):
|
||||
buffer = append(buffer, char)
|
||||
case char == ':' || char == endOfSpec:
|
||||
case (char == ':' || char == endOfSpec) && inVarSubstitution == 0:
|
||||
if err := populateFieldFromBuffer(char, buffer, &volume); err != nil {
|
||||
populateType(&volume)
|
||||
return volume, fmt.Errorf("invalid spec: %s: %w", spec, err)
|
||||
|
||||
+2
-3
@@ -81,13 +81,12 @@ func applyServiceExtends(ctx context.Context, name string, services map[string]a
|
||||
|
||||
var (
|
||||
base any
|
||||
processor PostProcessor
|
||||
processor PostProcessor = NoopPostProcessor{}
|
||||
)
|
||||
|
||||
if file != nil {
|
||||
refFilename := file.(string)
|
||||
services, processor, err = getExtendsBaseFromFile(ctx, name, ref, filename, refFilename, opts, tracker)
|
||||
post = append(post, processor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -105,7 +104,7 @@ func applyServiceExtends(ctx context.Context, name string, services map[string]a
|
||||
}
|
||||
|
||||
// recursively apply `extends`
|
||||
base, err = applyServiceExtends(ctx, ref, services, opts, tracker, post...)
|
||||
base, err = applyServiceExtends(ctx, ref, services, opts, tracker, processor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
+3
@@ -177,6 +177,9 @@ func importResources(source map[string]any, target map[string]any) error {
|
||||
if err := importResource(source, target, "configs"); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := importResource(source, target, "models"); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -260,12 +260,14 @@ func WithProfiles(profiles []string) func(*Options) {
|
||||
// PostProcessor is used to tweak compose model based on metadata extracted during yaml Unmarshal phase
|
||||
// that hardly can be implemented using go-yaml and mapstructure
|
||||
type PostProcessor interface {
|
||||
yaml.Unmarshaler
|
||||
|
||||
// Apply changes to compose model based on recorder metadata
|
||||
Apply(interface{}) error
|
||||
}
|
||||
|
||||
type NoopPostProcessor struct{}
|
||||
|
||||
func (NoopPostProcessor) Apply(interface{}) error { return nil }
|
||||
|
||||
// LoadConfigFiles ingests config files with ResourceLoader and returns config details with paths to local copies
|
||||
func LoadConfigFiles(ctx context.Context, configFiles []string, workingDir string, options ...func(*Options)) (*types.ConfigDetails, error) {
|
||||
if len(configFiles) < 1 {
|
||||
|
||||
+17
-12
@@ -531,19 +531,24 @@
|
||||
{"type": "object",
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9._-]+$": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"endpoint_var": {
|
||||
"type": "string",
|
||||
"description": "Environment variable set to AI model endpoint."
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"endpoint_var": {
|
||||
"type": "string",
|
||||
"description": "Environment variable set to AI model endpoint."
|
||||
},
|
||||
"model_var": {
|
||||
"type": "string",
|
||||
"description": "Environment variable set to AI model name."
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {"^x-": {}}
|
||||
},
|
||||
"model_var": {
|
||||
"type": "string",
|
||||
"description": "Environment variable set to AI model name."
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {"^x-": {}}
|
||||
{"type": "null"}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ type ServiceConfig struct {
|
||||
}
|
||||
|
||||
type ServiceProviderConfig struct {
|
||||
Type string `yaml:"type,omitempty" json:"driver,omitempty"`
|
||||
Type string `yaml:"type,omitempty" json:"type,omitempty"`
|
||||
Options MultiOptions `yaml:"options,omitempty" json:"options,omitempty"`
|
||||
Extensions Extensions `yaml:"#extensions,inline,omitempty" json:"-"`
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -119,7 +119,7 @@ github.com/aws/smithy-go/transport/http/internal/io
|
||||
# github.com/cenkalti/backoff/v4 v4.3.0
|
||||
## explicit; go 1.18
|
||||
github.com/cenkalti/backoff/v4
|
||||
# github.com/compose-spec/compose-go/v2 v2.9.0
|
||||
# github.com/compose-spec/compose-go/v2 v2.9.1
|
||||
## explicit; go 1.23
|
||||
github.com/compose-spec/compose-go/v2/cli
|
||||
github.com/compose-spec/compose-go/v2/consts
|
||||
|
||||
Reference in New Issue
Block a user