Skip to content

Commit c3a57cf

Browse files
committed
define a json ref for service secrets and confids properties
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 01cc80e commit c3a57cf

File tree

1 file changed

+24
-60
lines changed

1 file changed

+24
-60
lines changed

schema/compose-spec.json

Lines changed: 24 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,7 @@
100100
"shm_size": {"type": ["integer", "string"]},
101101
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
102102
"isolation": {"type": "string"},
103-
"secrets": {
104-
"type": "array",
105-
"items": {
106-
"oneOf": [
107-
{"type": "string"},
108-
{
109-
"type": "object",
110-
"properties": {
111-
"source": {"type": "string"},
112-
"target": {"type": "string"},
113-
"uid": {"type": "string"},
114-
"gid": {"type": "string"},
115-
"mode": {"type": "number"}
116-
},
117-
"additionalProperties": false,
118-
"patternProperties": {"^x-": {}}
119-
}
120-
]
121-
}
122-
}
103+
"secrets": {"$ref": "#/definitions/service_config_or_secret"}
123104
},
124105
"additionalProperties": false,
125106
"patternProperties": {"^x-": {}}
@@ -162,26 +143,7 @@
162143
{"type": "array", "items": {"type": "string"}}
163144
]
164145
},
165-
"configs": {
166-
"type": "array",
167-
"items": {
168-
"oneOf": [
169-
{"type": "string"},
170-
{
171-
"type": "object",
172-
"properties": {
173-
"source": {"type": "string"},
174-
"target": {"type": "string"},
175-
"uid": {"type": "string"},
176-
"gid": {"type": "string"},
177-
"mode": {"type": "number"}
178-
},
179-
"additionalProperties": false,
180-
"patternProperties": {"^x-": {}}
181-
}
182-
]
183-
}
184-
},
146+
"configs": {"$ref": "#/definitions/service_config_or_secret"},
185147
"container_name": {"type": "string"},
186148
"cpu_count": {"type": "integer", "minimum": 0},
187149
"cpu_percent": {"type": "integer", "minimum": 0, "maximum": 100},
@@ -370,26 +332,7 @@
370332
},
371333
"security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
372334
"shm_size": {"type": ["number", "string"]},
373-
"secrets": {
374-
"type": "array",
375-
"items": {
376-
"oneOf": [
377-
{"type": "string"},
378-
{
379-
"type": "object",
380-
"properties": {
381-
"source": {"type": "string"},
382-
"target": {"type": "string"},
383-
"uid": {"type": "string"},
384-
"gid": {"type": "string"},
385-
"mode": {"type": "number"}
386-
},
387-
"additionalProperties": false,
388-
"patternProperties": {"^x-": {}}
389-
}
390-
]
391-
}
392-
},
335+
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
393336
"sysctls": {"$ref": "#/definitions/list_or_dict"},
394337
"stdin_open": {"type": "boolean"},
395338
"stop_grace_period": {"type": "string", "format": "duration"},
@@ -827,6 +770,27 @@
827770
"additionalProperties": false
828771
},
829772

773+
"service_config_or_secret": {
774+
"type": "array",
775+
"items": {
776+
"oneOf": [
777+
{"type": "string"},
778+
{
779+
"type": "object",
780+
"properties": {
781+
"source": {"type": "string"},
782+
"target": {"type": "string"},
783+
"uid": {"type": "string"},
784+
"gid": {"type": "string"},
785+
"mode": {"type": "number"}
786+
},
787+
"additionalProperties": false,
788+
"patternProperties": {"^x-": {}}
789+
}
790+
]
791+
}
792+
},
793+
830794
"constraints": {
831795
"service": {
832796
"id": "#/definitions/constraints/service",

0 commit comments

Comments
 (0)