Skip to content

Commit

Permalink
extending a service, dependencies must be excluded
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <[email protected]>
  • Loading branch information
ndeloof committed Dec 9, 2024
1 parent 9a9cc5d commit c72f5e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion loader/extends.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"github.com/compose-spec/compose-go/v2/types"
)

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 {
Expand Down Expand Up @@ -123,7 +125,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
}
Expand Down

0 comments on commit c72f5e7

Please sign in to comment.