Skip to content

Commit

Permalink
define a json ref for service secrets and confids properties
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
  • Loading branch information
glours authored and ndeloof committed Apr 11, 2022
1 parent a797a7b commit 846cabc
Showing 1 changed file with 24 additions and 60 deletions.
84 changes: 24 additions & 60 deletions schema/compose-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,7 @@
"shm_size": {"type": ["integer", "string"]},
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
"isolation": {"type": "string"},
"secrets": {
"type": "array",
"items": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"properties": {
"source": {"type": "string"},
"target": {"type": "string"},
"uid": {"type": "string"},
"gid": {"type": "string"},
"mode": {"type": "number"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
}
}
"secrets": {"$ref": "#/definitions/service_config_or_secret"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
Expand Down Expand Up @@ -162,26 +143,7 @@
{"type": "array", "items": {"type": "string"}}
]
},
"configs": {
"type": "array",
"items": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"properties": {
"source": {"type": "string"},
"target": {"type": "string"},
"uid": {"type": "string"},
"gid": {"type": "string"},
"mode": {"type": "number"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
}
},
"configs": {"$ref": "#/definitions/service_config_or_secret"},
"container_name": {"type": "string"},
"cpu_count": {"type": "integer", "minimum": 0},
"cpu_percent": {"type": "integer", "minimum": 0, "maximum": 100},
Expand Down Expand Up @@ -370,26 +332,7 @@
},
"security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
"shm_size": {"type": ["number", "string"]},
"secrets": {
"type": "array",
"items": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"properties": {
"source": {"type": "string"},
"target": {"type": "string"},
"uid": {"type": "string"},
"gid": {"type": "string"},
"mode": {"type": "number"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
}
},
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
"sysctls": {"$ref": "#/definitions/list_or_dict"},
"stdin_open": {"type": "boolean"},
"stop_grace_period": {"type": "string", "format": "duration"},
Expand Down Expand Up @@ -827,6 +770,27 @@
"additionalProperties": false
},

"service_config_or_secret": {
"type": "array",
"items": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"properties": {
"source": {"type": "string"},
"target": {"type": "string"},
"uid": {"type": "string"},
"gid": {"type": "string"},
"mode": {"type": "number"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
}
},

"constraints": {
"service": {
"id": "#/definitions/constraints/service",
Expand Down

0 comments on commit 846cabc

Please sign in to comment.