feature: compose config should purge nested x-* tags
Version
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
Description
docker-compose config should purge nested x-fields
Design idea
input
version: '2'
x-common: &common
volumes: &common-volumes
- /data:/data
x-volumes: &common-cache-volumes
- /data:/data
- /cache:/cache
services:
service-foo:
<<: *common
image: docker.io/hello-world:latest
Expected output:
$ docker-compose config
version: '2'
services:
service-foo:
image: docker.io/hello-world:latest
volumes:
- /data:/data:rw
Actual output:
services:
service-foo:
image: docker.io/hello-world:latest
volumes:
- /data:/data:rw
x-volumes:
- /data:/data
- /cache:/cache
version: '2'
x-* syntax is actually used by the Compose Specification to let Compose implementations define custom extensions (like x-aws-cluster for ECS deployment). Is there any reason you use x-volumes in this example for anchored element?
Why does compose config remove the top level x- but not the nested x- fields? Inconsistent. If compose care about sub top level extensions it should obliviously also keep the top level, correct?
The reason why I used x-volumes was to keep volumes definitions together in one place for visibility.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.