mirror of https://github.com/docker/compose.git
Allow `x-*` extension on 3rd level objects
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 <vincent@sbr.pm>
This commit is contained in:
parent
b9cccf2efc
commit
7a19b7548f
|
@ -346,6 +346,7 @@
|
|||
"dependencies": {
|
||||
"memswap_limit": ["mem_limit"]
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
@ -409,6 +410,7 @@
|
|||
"labels": {"$ref": "#/definitions/labels"},
|
||||
"name": {"type": "string"}
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
@ -451,6 +453,7 @@
|
|||
"labels": {"$ref": "#/definitions/labels"},
|
||||
"name": {"type": "string"}
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
|
|
@ -319,6 +319,7 @@
|
|||
},
|
||||
"working_dir": {"type": "string"}
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
@ -489,6 +490,7 @@
|
|||
"attachable": {"type": "boolean"},
|
||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
@ -513,6 +515,7 @@
|
|||
},
|
||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
@ -530,6 +533,7 @@
|
|||
},
|
||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
@ -547,6 +551,7 @@
|
|||
},
|
||||
"labels": {"$ref": "#/definitions/list_or_dict"}
|
||||
},
|
||||
"patternProperties": {"^x-": {}},
|
||||
"additionalProperties": false
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue