-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow x-*
extension on 3rd level objects
#1097
Conversation
As for top-level key, any 3rd-level key which starts with `x-` will be ignored by compose. This allows for users to: * include additional metadata in their compose files * create YAML anchor objects that can be re-used in other parts of the config This matches a similar feature in the swagger spec definition: https://swagger.io/specification/#specificationExtensions This means a composefile like the following is valid ``` verison: "3.7" services: foo: image: foo/bar x-foo: bar network: bar: x-bar: baz ``` It concerns services, volumes, networks, configs and secrets. Signed-off-by: Vincent Demeester <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM 👍
Does docker-compose need this feature too? |
@silvin-lubecki yes, there is already a PR in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Okay, let's merge! |
As for top-level key, any 3rd-level key which starts with
x-
will beignored by compose. This allows for users to:
This matches a similar feature in the swagger spec definition:
https://swagger.io/specification/#specificationExtensions
This means a composefile like the following is valid
It concerns services, volumes, networks, configs and secrets.
Signed-off-by: Vincent Demeester [email protected]