bump compose-go to version v2.1.3

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours
2024-06-21 15:04:10 +02:00
parent 9b100c2552
commit 689fd74104
17 changed files with 2095 additions and 1204 deletions

View File

@ -100,7 +100,13 @@ type Secrets map[string]SecretConfig
type Configs map[string]ConfigObjConfig
// Extensions is a map of custom extension
type Extensions map[string]interface{}
type Extensions map[string]any
func (e Extensions) DeepCopy(t Extensions) {
for k, v := range e {
t[k] = v
}
}
// MarshalJSON makes Config implement json.Marshaler
func (c Config) MarshalJSON() ([]byte, error) {

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,6 @@ import (
"github.com/compose-spec/compose-go/v2/errdefs"
"github.com/compose-spec/compose-go/v2/utils"
"github.com/distribution/reference"
"github.com/mitchellh/copystructure"
godigest "github.com/opencontainers/go-digest"
"golang.org/x/exp/maps"
"golang.org/x/sync/errgroup"
@ -646,11 +645,13 @@ func (p Project) WithServicesEnvironmentResolved(discardEnvFiles bool) (*Project
}
func (p *Project) deepCopy() *Project {
instance, err := copystructure.Copy(p)
if err != nil {
panic(err)
if p == nil {
return nil
}
return instance.(*Project)
n := &Project{}
deriveDeepCopyProject(n, p)
return n
}
// WithServicesTransform applies a transformation to project services and return a new project with transformation results

View File

@ -24,7 +24,6 @@ import (
"strings"
"github.com/docker/go-connections/nat"
"github.com/mitchellh/copystructure"
)
// ServiceConfig is the configuration of one service
@ -194,11 +193,12 @@ func (s *ServiceConfig) SetScale(scale int) {
}
func (s *ServiceConfig) deepCopy() *ServiceConfig {
instance, err := copystructure.Copy(s)
if err != nil {
panic(err)
if s == nil {
return nil
}
return instance.(*ServiceConfig)
n := &ServiceConfig{}
deriveDeepCopyService(n, s)
return n
}
const (
@ -698,7 +698,7 @@ type NetworkConfig struct {
Internal bool `yaml:"internal,omitempty" json:"internal,omitempty"`
Attachable bool `yaml:"attachable,omitempty" json:"attachable,omitempty"`
Labels Labels `yaml:"labels,omitempty" json:"labels,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:"-"`
}
@ -711,11 +711,11 @@ type IPAMConfig struct {
// IPAMPool for a network
type IPAMPool struct {
Subnet string `yaml:"subnet,omitempty" json:"subnet,omitempty"`
Gateway string `yaml:"gateway,omitempty" json:"gateway,omitempty"`
IPRange string `yaml:"ip_range,omitempty" json:"ip_range,omitempty"`
AuxiliaryAddresses Mapping `yaml:"aux_addresses,omitempty" json:"aux_addresses,omitempty"`
Extensions map[string]interface{} `yaml:",inline" json:"-"`
Subnet string `yaml:"subnet,omitempty" json:"subnet,omitempty"`
Gateway string `yaml:"gateway,omitempty" json:"gateway,omitempty"`
IPRange string `yaml:"ip_range,omitempty" json:"ip_range,omitempty"`
AuxiliaryAddresses Mapping `yaml:"aux_addresses,omitempty" json:"aux_addresses,omitempty"`
Extensions Extensions `yaml:",inline" json:"-"`
}
// VolumeConfig for a volume