vendor: update compose-go to v1.20.0

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-10-21 08:29:01 +02:00
parent be4fd7110d
commit 05a0fdf744
20 changed files with 605 additions and 303 deletions

View File

@ -20,6 +20,7 @@ import (
"context"
"fmt"
"path/filepath"
"reflect"
"github.com/compose-spec/compose-go/dotenv"
interp "github.com/compose-spec/compose-go/interpolation"
@ -109,37 +110,55 @@ func loadInclude(ctx context.Context, filename string, configDetails types.Confi
func importResources(model *types.Config, imported *types.Project, path []string) error {
services := mapByName(model.Services)
for _, service := range imported.Services {
if _, ok := services[service.Name]; ok {
if present, ok := services[service.Name]; ok {
if reflect.DeepEqual(present, service) {
continue
}
return fmt.Errorf("imported compose file %s defines conflicting service %s", path, service.Name)
}
model.Services = append(model.Services, service)
}
for _, service := range imported.DisabledServices {
if _, ok := services[service.Name]; ok {
if disabled, ok := services[service.Name]; ok {
if reflect.DeepEqual(disabled, service) {
continue
}
return fmt.Errorf("imported compose file %s defines conflicting service %s", path, service.Name)
}
model.Services = append(model.Services, service)
}
for n, network := range imported.Networks {
if _, ok := model.Networks[n]; ok {
if present, ok := model.Networks[n]; ok {
if reflect.DeepEqual(present, network) {
continue
}
return fmt.Errorf("imported compose file %s defines conflicting network %s", path, n)
}
model.Networks[n] = network
}
for n, volume := range imported.Volumes {
if _, ok := model.Volumes[n]; ok {
if present, ok := model.Volumes[n]; ok {
if reflect.DeepEqual(present, volume) {
continue
}
return fmt.Errorf("imported compose file %s defines conflicting volume %s", path, n)
}
model.Volumes[n] = volume
}
for n, secret := range imported.Secrets {
if _, ok := model.Secrets[n]; ok {
if present, ok := model.Secrets[n]; ok {
if reflect.DeepEqual(present, secret) {
continue
}
return fmt.Errorf("imported compose file %s defines conflicting secret %s", path, n)
}
model.Secrets[n] = secret
}
for n, config := range imported.Configs {
if _, ok := model.Configs[n]; ok {
if present, ok := model.Configs[n]; ok {
if reflect.DeepEqual(present, config) {
continue
}
return fmt.Errorf("imported compose file %s defines conflicting config %s", path, n)
}
model.Configs[n] = config