bump compose-go v2.4.6

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof
2024-12-13 16:00:43 +01:00
parent 3e3242cfdd
commit 828c1dbf98
18 changed files with 189 additions and 14 deletions

View File

@ -27,6 +27,10 @@ import (
"github.com/compose-spec/compose-go/v2/types"
)
// as we use another service definition by `extends`, we must exclude attributes which creates dependency to another service
// see https://github.com/compose-spec/compose-spec/blob/main/05-services.md#restrictions
var exclusions = []string{"extends", "depends_on", "volumes_from"}
func ApplyExtends(ctx context.Context, dict map[string]any, opts *Options, tracker *cycleTracker, post ...PostProcessor) error {
a, ok := dict["services"]
if !ok {
@ -123,7 +127,9 @@ func applyServiceExtends(ctx context.Context, name string, services map[string]a
if err != nil {
return nil, err
}
delete(merged, "extends")
for _, exclusion := range exclusions {
delete(merged, exclusion)
}
services[name] = merged
return merged, nil
}