From 0adccacb38f5862a94fedc811aa7f3b1e8009263 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 14 Jul 2017 17:05:31 -0400 Subject: [PATCH 1/2] Add Compose format 3.4 Signed-off-by: Daniel Nephin --- cli/compose/schema/bindata.go | 23 + .../schema/data/config_schema_v3.4.json | 534 ++++++++++++++++++ 2 files changed, 557 insertions(+) create mode 100644 cli/compose/schema/data/config_schema_v3.4.json diff --git a/cli/compose/schema/bindata.go b/cli/compose/schema/bindata.go index 06fcae3591..cba2c1e17c 100644 --- a/cli/compose/schema/bindata.go +++ b/cli/compose/schema/bindata.go @@ -4,6 +4,7 @@ // data/config_schema_v3.1.json // data/config_schema_v3.2.json // data/config_schema_v3.3.json +// data/config_schema_v3.4.json // DO NOT EDIT! package schema @@ -151,6 +152,26 @@ func dataConfig_schema_v33Json() (*asset, error) { return a, nil } +var _dataConfig_schema_v34Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\xcd\x93\xdb\xa0\x15\xbf\xfb\xaf\xd0\x28\xb9\x65\x3f\x32\xd3\x4c\x67\x9a\x5b\x8f\x3d\xb5\xe7\xee\x38\x1a\x8c\x9e\x6d\xb2\x08\x08\x20\xef\x3a\x99\xfd\xdf\x3b\xfa\x34\x20\x10\xd8\xd6\x66\xb7\x6d\x4e\xbb\x96\x7e\x0f\x78\xdf\xef\x01\xfa\xb5\xca\xb2\xfc\xa3\xc2\x7b\xa8\x50\xfe\x35\xcb\xf7\x5a\x8b\xaf\xf7\xf7\xdf\x15\x67\xb7\xdd\xd3\x3b\x2e\x77\xf7\xa5\x44\x5b\x7d\xfb\xf9\xcb\x7d\xf7\xec\x43\x7e\xd3\xd0\x91\xb2\x21\xc1\x9c\x6d\xc9\xae\xe8\xde\x14\x87\xbf\xdc\x7d\xb9\x6b\xc8\x3b\x88\x3e\x0a\x68\x40\x7c\xf3\x1d\xb0\xee\x9e\x49\xf8\x51\x13\x09\x0d\xf1\x43\x7e\x00\xa9\x08\x67\xf9\xfa\x66\xd5\xbc\x13\x92\x0b\x90\x9a\x80\xca\xbf\x66\xcd\xe2\xb2\x6c\x84\x0c\x0f\x8c\x61\x95\x96\x84\xed\xf2\xf6\xf1\x4b\x3b\x42\x96\xe5\x0a\xe4\x81\x60\x63\x84\x71\xa9\x1f\xee\x4f\xe3\xdf\x8f\xb0\x1b\x77\x54\x63\xb1\xed\x73\x81\xb4\x06\xc9\xfe\x35\x5d\x5b\xfb\xfa\xdb\x03\xba\xfd\xf9\xf7\xdb\x7f\x7f\xbe\xfd\xdb\x5d\x71\xbb\xfe\xf4\xd1\x7a\xdd\xc8\x57\xc2\xb6\x9b\xbe\x84\x2d\x61\x44\x13\xce\xc6\xf9\xf3\x11\xf9\xd2\xff\xf7\x32\x4e\x8c\xca\xb2\x05\x23\x6a\xcd\xbd\x45\x54\x81\xcd\x33\x03\xfd\xc4\xe5\x63\x8c\xe7\x11\xf6\x46\x3c\xf7\xf3\x7b\x78\xb6\xd9\x39\x70\x5a\x57\x51\x0d\x0e\xa8\x37\x62\xa6\x9b\x7e\x19\xfd\x29\xc0\x12\x74\xdc\x64\x3b\xd4\x9b\x59\x6c\x33\xfd\x32\x0c\x77\x51\x23\xc6\xf0\x80\x7a\x23\x86\xbb\xe9\xaf\x63\x78\x35\x30\x3d\x8b\xed\x10\xc6\xdc\xed\x02\xad\x78\xe6\x13\x95\x2f\x9e\x84\x65\x35\x0a\x2b\x20\xa5\x12\x04\xe5\xc7\xe6\x59\x40\x1e\x1d\xa0\x02\xa6\xf3\x51\x04\x59\x96\x6f\x6a\x42\x4b\x57\xa2\x9c\xc1\x3f\x9b\x21\x1e\x8c\x87\x59\xf6\xcb\x0d\xdd\xc6\x38\xed\x7b\xeb\x57\x58\xe1\xe3\xfb\x00\x2f\xe3\x7b\xcc\x99\x86\x67\xdd\x32\x35\x3f\x75\x27\x02\x8e\x1f\x41\x6e\x09\x85\x54\x0a\x24\x3b\x2b\x0e\x88\x8c\x12\xa5\x0b\x2e\x8b\x92\x60\xed\xa5\xa7\x68\x03\xf4\xaa\x11\x30\xc2\x7b\x28\xb6\x92\x57\xd1\x51\xb6\x45\xc7\x89\xca\x5f\x9c\x71\x26\x03\xc7\x4d\x7b\x24\x35\x7e\xad\x57\x9e\x01\x73\x8c\x44\x81\xca\xd2\x12\x29\x92\x12\x1d\xf3\x9b\x2c\x27\x1a\x2a\xe5\x97\x76\x96\xd7\x8c\xfc\xa8\xe1\x1f\x3d\x44\xcb\x1a\xdc\x71\x4b\xc9\xc5\xf2\x03\xef\x24\xaf\x45\x21\x90\x6c\x6c\x7d\xde\x12\x72\xcc\xab\x0a\xb1\xa5\x1c\xe0\x1c\x3e\x12\x24\x3f\x09\xb3\x99\xe9\x55\xfd\x1c\xe6\xab\x71\x36\x6b\x59\x01\x6e\xe2\xfc\x4c\x5d\x3a\xee\xd4\x71\xb7\x6e\xa2\x22\xaf\x25\x4e\xf5\xd2\x66\x4e\x24\x77\x90\x1a\x07\xb2\x2c\xaf\x49\x99\x0e\xde\x9d\x03\xae\x78\x69\xaf\x9b\xd5\xd5\x06\xe4\xc4\x25\x6d\xcf\x9a\xfe\x5e\xaf\x7c\x6f\x1c\xed\x6b\x44\x18\xc8\x82\xa1\x2a\x26\xab\x1c\x4b\x28\x81\x69\x82\x68\xa1\x04\x60\x0b\x3e\x68\x6a\x46\x33\x79\x52\xd4\xcc\x25\xec\x88\xd2\xf2\xe8\x45\x9e\xb8\x30\x17\x56\x82\x00\x56\xaa\xa2\xeb\x01\x52\x03\x9c\x35\xc0\xd8\x10\x2c\x1a\x26\x4a\x36\x17\xb8\xbb\x61\x9a\xd0\xdd\xac\x2d\x77\x08\x0b\x05\x48\xe2\xfd\x85\xf4\xbc\x42\x84\xa5\x28\x15\x98\x96\x47\xc1\x49\x17\xc6\xde\x5d\x7c\x02\x76\x28\x46\xbb\x39\x5b\x0c\xc0\x0e\x44\x72\x56\x0d\x41\x3a\x2d\x81\x1a\xf4\xcf\x82\x2b\xb8\x3e\x38\xf6\x14\x0f\x03\xe3\x37\xa3\x4f\xaf\x6d\xe9\xe5\x5b\x2e\x2b\xd4\x2c\x76\x98\xdb\xf4\x61\x6b\xaa\xa9\xe5\x99\x02\x34\x79\x68\x0a\x5f\x44\x0b\x4a\xd8\xe3\xf2\x26\x0e\xcf\x5a\xa2\x62\xcf\x95\xbe\xa4\x46\xc9\xf7\x80\xa8\xde\xe3\x3d\xe0\xc7\x19\x72\x13\x65\x51\x73\xa5\x53\x8c\x9c\x54\x68\x17\x07\x09\x1c\x83\x5c\x5c\x8b\xe5\x8b\x0a\xdf\x18\x96\xef\x76\x0d\x34\x64\x71\x93\xda\xbe\x7f\x1d\xab\x8a\x4b\x49\x0e\x20\x53\x4b\x5c\x2e\x4e\x2d\x89\xfb\x32\x25\x9b\x47\xfb\x33\x0b\xfa\xed\xae\x6b\xcf\x66\xbc\xaa\xfd\x8f\xd2\x7c\x3d\x4d\x99\xd3\xa4\xe9\x3e\x71\x38\x4c\xab\x73\x2d\xad\x54\x08\x37\xe5\xac\x04\x15\xd0\xeb\x09\xda\x6f\x78\x14\x93\x9c\x7f\xc2\x4e\xc0\x93\xc4\x1a\x8a\xd4\x67\x27\xc2\xec\xa2\x0e\x2b\x49\x75\xd1\x16\x3b\xc2\x4d\x68\x79\xa9\xcb\x3c\x2d\x37\x6e\x62\x2d\x0e\x51\x82\x14\xc4\x9d\x3d\x28\x48\x6b\x34\x22\x0e\x5f\x12\x6d\xc2\x47\xfb\xd7\x59\xda\x00\x69\x70\xcc\xf4\xd6\x2d\x32\x94\x59\xa2\x52\xea\x5d\xc8\x3a\x5e\xb4\xbe\x66\x67\x29\xec\xc2\xdb\x8e\x15\x6d\x84\x30\x1d\x4c\x70\xa9\x7f\x4b\x2f\x74\x8a\x53\xa7\x84\xdf\x4d\x3e\x6d\x8f\x5c\x75\x27\x11\xbd\x4e\x4f\x35\x13\xa5\x3c\x68\x4f\x47\x45\x98\x86\x5d\xd3\xca\xf8\x93\x40\xbd\xa1\x44\xed\xa1\x3c\x87\x46\x72\xcd\x31\xa7\x69\x8e\xe1\xdd\xa0\x49\x77\x86\x99\xfe\xea\xa2\xda\x4c\x48\x72\x20\x14\x76\x0e\xc7\x1b\xce\x29\x20\x66\x25\x0a\x09\xa8\x2c\x38\xa3\xc7\x04\xa4\xd2\x48\x46\x77\x25\x14\xe0\x5a\x12\x7d\x2c\xb8\xd0\x8b\x57\x85\x6a\x5f\x15\x8a\xfc\x04\xdb\xf7\x4e\x56\xdf\x0f\xb4\x76\x16\xe4\x6c\x71\x67\x7f\xb6\x22\xfe\x6f\xb6\x22\xd4\x51\x61\x7d\x59\x6d\xad\x74\x49\x58\xc1\x05\xb0\xa8\x6f\x28\xcd\x45\xb1\x93\x08\x43\x21\x40\x12\xee\x15\x85\x15\x60\xcb\x5a\xa2\x66\xfe\xe9\x30\x8a\xec\x18\xf2\xc7\x1d\x03\xaa\x2b\xb1\xbd\x70\x13\x40\xeb\xb8\xb3\xd7\x94\x54\x24\xec\x34\x1e\xab\x4d\xa8\xd7\xba\x5a\xcd\x5f\xa2\xcd\x94\x67\x49\x21\x7b\xa6\x43\x98\x6f\x10\x12\x3a\x83\x3d\x92\x67\xa4\x8e\xd6\x31\xb7\x81\xfc\xe4\xeb\x1b\xbc\xeb\xb2\x0e\xab\xdb\xf1\x6e\xfa\x85\xac\xbd\xf8\xb3\x4a\x2f\x77\x19\xeb\x60\xf5\xe3\x77\xaa\x5a\x45\x9b\xb8\x16\xc3\xd4\x5c\x03\x32\x42\xa7\xa7\xae\xd9\x7f\x45\x84\xb6\x74\xd4\xc2\x3d\xba\x49\x88\xe3\xfd\x4c\x89\xb1\xf3\xb5\xa3\x7e\x72\x45\x60\xd0\x60\xce\x14\x51\x1a\x18\xf6\xef\xaf\x7a\x89\x36\x64\x72\x78\x31\x15\xca\x7c\xdf\x95\xd6\x75\xb5\x28\xb4\xeb\xe2\x6d\x72\xa3\x93\xee\xab\xfd\x81\xfc\x6f\x61\x85\x71\xcc\x45\x40\x35\xe9\x6c\x9c\x9b\x66\x9d\xad\x8b\x99\x3a\x34\x14\x32\x9e\xb8\x7c\x6c\x12\x52\x49\xfc\x91\x63\xe5\x90\x9c\x71\xa4\xef\xec\xf5\x0d\x03\xf8\xce\xaa\x4d\x68\xf4\x6c\x7f\xfe\xdc\xbc\x07\x05\xcf\xb4\x89\x42\x1b\xe7\x5c\xc2\x97\x68\x9b\xcc\x20\x0f\xf1\x7c\x2f\x41\x4b\xe2\x1c\x25\x0c\x45\x93\x99\xdb\x41\xbd\xcf\x0d\x77\x4d\x2a\xe0\xb5\x3f\x0c\xad\x4c\xc3\xe9\x89\x72\xe3\xcc\x3f\xa2\x54\x03\xe9\xea\xf4\xc1\x38\x40\xea\xfa\xf2\xa8\xe2\x52\x12\x16\xb0\xb2\x3d\xda\x48\xca\x6e\x12\x04\x25\x18\xa9\x58\x05\x71\xc5\x2e\x70\x2d\x4a\xa4\xa1\xe8\xaf\x8d\x9c\x53\xb3\xcd\x14\x6b\x02\x49\x44\x29\x50\xa2\xaa\x94\xe2\x27\x2f\x81\x22\x6f\xf4\x8f\xd6\xbd\x2d\xf9\x16\x11\x5a\x4b\x28\x10\x0e\x86\x69\x87\xa2\xe2\x8c\x68\xee\x0d\x27\x69\x53\x56\xe8\xb9\x18\xa6\x6d\x21\xb1\x96\xc4\xee\xc6\x53\x37\x70\x0d\x4b\xe8\x72\xf7\x79\x65\xf5\x8c\x8a\x4e\x45\x7a\xc0\x62\x86\x19\x27\xac\x4b\x50\x4d\xd8\x19\xf7\xd7\xa3\xf4\xd1\x00\xdf\x6f\x0f\x14\x82\x53\xd2\x55\x01\x4b\x70\x88\x39\xeb\x84\x9c\x62\x10\x57\x5a\x60\x63\x0e\x4d\x0f\x53\x09\x1d\x75\xd6\x96\xe0\x89\xb0\x92\x3f\x9d\x31\xe1\x72\xa6\x24\x28\xc2\xe0\x04\xc7\x6b\x05\xad\xb4\x44\x84\xe9\xb3\x8f\x93\x5c\xb1\x08\x09\x5b\x90\xc0\xa6\x86\x9e\xcd\x97\xf5\x59\xb8\xb4\x8f\xf1\x16\xe7\xb0\x47\x28\xd1\xd4\xb7\x6f\xb0\xab\x77\xad\xf2\xaf\x28\x90\x46\x2f\x8e\x24\xd2\x11\x17\x2d\x8d\x42\xc9\x13\x8b\x3a\x7a\x34\x55\x41\xc5\xe7\xaf\x61\x5c\x71\x11\x39\xc6\xe2\x00\x5b\xa0\x50\x48\x3a\xcb\xec\x51\x05\x17\xcb\x6f\xa6\xc4\xcf\x2b\xd7\xf1\xb0\x4d\x04\xaa\x96\x8a\x21\xc9\xa7\xbb\xb9\xb7\x52\xc9\xde\x41\x74\xa8\x37\x2c\xd0\x2b\xbf\xef\xe8\x60\xdf\x9c\x68\x2f\x66\x04\xb4\xfa\x30\xb6\x21\x37\xa3\xac\xd6\xc9\x2a\x0e\xde\x8a\x58\x6e\xfd\x6d\x47\xe4\xee\x80\xfa\x5a\x27\xa4\x35\xc2\xfb\xa4\x2e\xeb\xcc\xd2\xfa\x8a\x38\x34\xd9\x0b\xf0\x86\xa1\x1e\xf5\x27\x0a\xfd\x8f\xd8\xec\xef\xb3\xaf\xfe\x5b\x88\xe8\x9d\xfc\x16\x75\x71\x1e\x4f\xb8\x52\xf9\x0e\x74\xf6\xc6\xaa\x98\x24\x31\xaf\x2a\x7a\xd4\x1f\x55\xbc\xaa\x57\xd8\xa7\x5d\x86\x4a\xa6\x9b\x5f\x73\x92\x3c\xf7\x2b\x86\xb5\xbd\x0c\x17\xe6\xf9\x72\xd0\xae\x6b\xe6\xce\xc2\x07\x48\x60\xb3\xd5\x99\xb4\x17\xe2\x3c\xe7\x0b\xc6\xfd\xbb\x4f\x33\xd5\xdb\xdc\xd5\xb9\x57\x2a\x7b\x16\xb8\x67\xe0\xd7\xa9\xd3\x18\x0f\xd2\x9d\x7e\x1c\x15\xf6\xff\x81\x7e\xf2\xa9\x54\xc3\x27\x3b\x4e\x36\x67\x7f\xd9\x27\x4b\xdd\x67\x4e\x6b\x4b\x3e\x0e\xa4\xbb\x88\x6a\x24\xda\xb5\xb9\x57\x10\xbc\x39\xef\xfb\x80\xca\x3d\xd7\x1a\x3e\x64\x0a\x1c\xb5\xaf\xcc\xbf\xed\x47\x67\xab\x97\xd5\x7f\x02\x00\x00\xff\xff\x8b\xd2\x8d\x87\xde\x3b\x00\x00") + +func dataConfig_schema_v34JsonBytes() ([]byte, error) { + return bindataRead( + _dataConfig_schema_v34Json, + "data/config_schema_v3.4.json", + ) +} + +func dataConfig_schema_v34Json() (*asset, error) { + bytes, err := dataConfig_schema_v34JsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "data/config_schema_v3.4.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. @@ -207,6 +228,7 @@ var _bindata = map[string]func() (*asset, error){ "data/config_schema_v3.1.json": dataConfig_schema_v31Json, "data/config_schema_v3.2.json": dataConfig_schema_v32Json, "data/config_schema_v3.3.json": dataConfig_schema_v33Json, + "data/config_schema_v3.4.json": dataConfig_schema_v34Json, } // AssetDir returns the file names below a certain @@ -254,6 +276,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "config_schema_v3.1.json": &bintree{dataConfig_schema_v31Json, map[string]*bintree{}}, "config_schema_v3.2.json": &bintree{dataConfig_schema_v32Json, map[string]*bintree{}}, "config_schema_v3.3.json": &bintree{dataConfig_schema_v33Json, map[string]*bintree{}}, + "config_schema_v3.4.json": &bintree{dataConfig_schema_v34Json, map[string]*bintree{}}, }}, }} diff --git a/cli/compose/schema/data/config_schema_v3.4.json b/cli/compose/schema/data/config_schema_v3.4.json new file mode 100644 index 0000000000..2457a2de81 --- /dev/null +++ b/cli/compose/schema/data/config_schema_v3.4.json @@ -0,0 +1,534 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "config_schema_v3.4.json", + "type": "object", + "required": ["version"], + + "properties": { + "version": { + "type": "string" + }, + + "services": { + "id": "#/properties/services", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/service" + } + }, + "additionalProperties": false + }, + + "networks": { + "id": "#/properties/networks", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/network" + } + } + }, + + "volumes": { + "id": "#/properties/volumes", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/volume" + } + }, + "additionalProperties": false + }, + + "secrets": { + "id": "#/properties/secrets", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/secret" + } + }, + "additionalProperties": false + }, + + "configs": { + "id": "#/properties/configs", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/config" + } + }, + "additionalProperties": false + } + }, + + "additionalProperties": false, + + "definitions": { + + "service": { + "id": "#/definitions/service", + "type": "object", + + "properties": { + "deploy": {"$ref": "#/definitions/deployment"}, + "build": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "context": {"type": "string"}, + "dockerfile": {"type": "string"}, + "args": {"$ref": "#/definitions/list_or_dict"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "cache_from": {"$ref": "#/definitions/list_of_strings"} + }, + "additionalProperties": false + } + ] + }, + "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "cgroup_parent": {"type": "string"}, + "command": { + "oneOf": [ + {"type": "string"}, + {"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"} + } + } + ] + } + }, + "container_name": {"type": "string"}, + "credential_spec": {"type": "object", "properties": { + "file": {"type": "string"}, + "registry": {"type": "string"} + }}, + "depends_on": {"$ref": "#/definitions/list_of_strings"}, + "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "dns": {"$ref": "#/definitions/string_or_list"}, + "dns_search": {"$ref": "#/definitions/string_or_list"}, + "domainname": {"type": "string"}, + "entrypoint": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, + "env_file": {"$ref": "#/definitions/string_or_list"}, + "environment": {"$ref": "#/definitions/list_or_dict"}, + + "expose": { + "type": "array", + "items": { + "type": ["string", "number"], + "format": "expose" + }, + "uniqueItems": true + }, + + "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "extra_hosts": {"$ref": "#/definitions/list_or_dict"}, + "healthcheck": {"$ref": "#/definitions/healthcheck"}, + "hostname": {"type": "string"}, + "image": {"type": "string"}, + "ipc": {"type": "string"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + + "logging": { + "type": "object", + + "properties": { + "driver": {"type": "string"}, + "options": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number", "null"]} + } + } + }, + "additionalProperties": false + }, + + "mac_address": {"type": "string"}, + "network_mode": {"type": "string"}, + + "networks": { + "oneOf": [ + {"$ref": "#/definitions/list_of_strings"}, + { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "oneOf": [ + { + "type": "object", + "properties": { + "aliases": {"$ref": "#/definitions/list_of_strings"}, + "ipv4_address": {"type": "string"}, + "ipv6_address": {"type": "string"} + }, + "additionalProperties": false + }, + {"type": "null"} + ] + } + }, + "additionalProperties": false + } + ] + }, + "pid": {"type": ["string", "null"]}, + + "ports": { + "type": "array", + "items": { + "oneOf": [ + {"type": "number", "format": "ports"}, + {"type": "string", "format": "ports"}, + { + "type": "object", + "properties": { + "mode": {"type": "string"}, + "target": {"type": "integer"}, + "published": {"type": "integer"}, + "protocol": {"type": "string"} + }, + "additionalProperties": false + } + ] + }, + "uniqueItems": true + }, + + "privileged": {"type": "boolean"}, + "read_only": {"type": "boolean"}, + "restart": {"type": "string"}, + "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"} + } + } + ] + } + }, + "sysctls": {"$ref": "#/definitions/list_or_dict"}, + "stdin_open": {"type": "boolean"}, + "stop_grace_period": {"type": "string", "format": "duration"}, + "stop_signal": {"type": "string"}, + "tmpfs": {"$ref": "#/definitions/string_or_list"}, + "tty": {"type": "boolean"}, + "ulimits": { + "type": "object", + "patternProperties": { + "^[a-z]+$": { + "oneOf": [ + {"type": "integer"}, + { + "type":"object", + "properties": { + "hard": {"type": "integer"}, + "soft": {"type": "integer"} + }, + "required": ["soft", "hard"], + "additionalProperties": false + } + ] + } + } + }, + "user": {"type": "string"}, + "userns_mode": {"type": "string"}, + "volumes": { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "required": ["type"], + "properties": { + "type": {"type": "string"}, + "source": {"type": "string"}, + "target": {"type": "string"}, + "read_only": {"type": "boolean"}, + "consistency": {"type": "string"}, + "bind": { + "type": "object", + "properties": { + "propagation": {"type": "string"} + } + }, + "volume": { + "type": "object", + "properties": { + "nocopy": {"type": "boolean"} + } + } + } + } + ], + "uniqueItems": true + } + }, + "working_dir": {"type": "string"} + }, + "additionalProperties": false + }, + + "healthcheck": { + "id": "#/definitions/healthcheck", + "type": "object", + "additionalProperties": false, + "properties": { + "disable": {"type": "boolean"}, + "interval": {"type": "string"}, + "retries": {"type": "number"}, + "test": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, + "timeout": {"type": "string"} + } + }, + "deployment": { + "id": "#/definitions/deployment", + "type": ["object", "null"], + "properties": { + "mode": {"type": "string"}, + "endpoint_mode": {"type": "string"}, + "replicas": {"type": "integer"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "update_config": { + "type": "object", + "properties": { + "parallelism": {"type": "integer"}, + "delay": {"type": "string", "format": "duration"}, + "failure_action": {"type": "string"}, + "monitor": {"type": "string", "format": "duration"}, + "max_failure_ratio": {"type": "number"} + }, + "additionalProperties": false + }, + "resources": { + "type": "object", + "properties": { + "limits": {"$ref": "#/definitions/resource"}, + "reservations": {"$ref": "#/definitions/resource"} + } + }, + "restart_policy": { + "type": "object", + "properties": { + "condition": {"type": "string"}, + "delay": {"type": "string", "format": "duration"}, + "max_attempts": {"type": "integer"}, + "window": {"type": "string", "format": "duration"} + }, + "additionalProperties": false + }, + "placement": { + "type": "object", + "properties": { + "constraints": {"type": "array", "items": {"type": "string"}}, + "preferences": { + "type": "array", + "items": { + "type": "object", + "properties": { + "spread": {"type": "string"} + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + + "resource": { + "id": "#/definitions/resource", + "type": "object", + "properties": { + "cpus": {"type": "string"}, + "memory": {"type": "string"} + }, + "additionalProperties": false + }, + + "network": { + "id": "#/definitions/network", + "type": ["object", "null"], + "properties": { + "driver": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "ipam": { + "type": "object", + "properties": { + "driver": {"type": "string"}, + "config": { + "type": "array", + "items": { + "type": "object", + "properties": { + "subnet": {"type": "string"} + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + }, + "additionalProperties": false + }, + "internal": {"type": "boolean"}, + "attachable": {"type": "boolean"}, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "volume": { + "id": "#/definitions/volume", + "type": ["object", "null"], + "properties": { + "driver": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + }, + "additionalProperties": false + }, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "secret": { + "id": "#/definitions/secret", + "type": "object", + "properties": { + "file": {"type": "string"}, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + } + }, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "config": { + "id": "#/definitions/config", + "type": "object", + "properties": { + "file": {"type": "string"}, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + } + }, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "string_or_list": { + "oneOf": [ + {"type": "string"}, + {"$ref": "#/definitions/list_of_strings"} + ] + }, + + "list_of_strings": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + + "list_or_dict": { + "oneOf": [ + { + "type": "object", + "patternProperties": { + ".+": { + "type": ["string", "number", "null"] + } + }, + "additionalProperties": false + }, + {"type": "array", "items": {"type": "string"}, "uniqueItems": true} + ] + }, + + "constraints": { + "service": { + "id": "#/definitions/constraints/service", + "anyOf": [ + {"required": ["build"]}, + {"required": ["image"]} + ], + "properties": { + "build": { + "required": ["context"] + } + } + } + } + } +} From 27a30808252d713e2691c492915984396a501a92 Mon Sep 17 00:00:00 2001 From: Liping Xue Date: Thu, 29 Jun 2017 16:25:50 -0700 Subject: [PATCH 2/2] Change to enable volume name can be customized. Signed-off-by: Liping Xue Change to enable volume name can be customized. Signed-off-by: Liping Xue Change to enable volume name can be customized. Remove unused debug info. Address comments from Daniel and solve the lint error. Signed-off-by: Liping Xue Address Daniel's comments to print warning message when name of external volume is set in loader code. Signed-off-by: Liping Xue Address Daniel's comments to return error when external volume is set in loader code. Signed-off-by: Liping Xue Address Daniel's comments to return error when external volume is set in loader code. Signed-off-by: Liping Xue Remove the case that specifying external volume name in full-example.yml. More fix. Add unit test. Signed-off-by: Liping Xue Address comments from Daniel, move the schema change to v3.4. Signed-off-by: Liping Xue Address comments from Sebastiaan. Signed-off-by: Liping Xue Address comments from Misty. Signed-off-by: Liping Xue --- cli/compose/convert/volume.go | 4 ++ cli/compose/convert/volume_test.go | 47 +++++++++++++++++++ cli/compose/loader/full-example.yml | 18 ++++++- cli/compose/loader/loader.go | 6 +++ cli/compose/loader/loader_test.go | 31 ++++++++++++ cli/compose/schema/bindata.go | 2 +- .../schema/data/config_schema_v3.4.json | 1 + cli/compose/types/types.go | 2 + 8 files changed, 109 insertions(+), 2 deletions(-) diff --git a/cli/compose/convert/volume.go b/cli/compose/convert/volume.go index e767b07ee9..8400f8d523 100644 --- a/cli/compose/convert/volume.go +++ b/cli/compose/convert/volume.go @@ -74,6 +74,10 @@ func convertVolumeToMount( return result, nil } + if stackVolume.Name != "" { + result.Source = stackVolume.Name + } + result.VolumeOptions.Labels = AddStackLabel(namespace, stackVolume.Labels) if stackVolume.Driver != "" || stackVolume.DriverOpts != nil { result.VolumeOptions.DriverConfig = &mount.Driver{ diff --git a/cli/compose/convert/volume_test.go b/cli/compose/convert/volume_test.go index c3d3c1d54e..9e921701a0 100644 --- a/cli/compose/convert/volume_test.go +++ b/cli/compose/convert/volume_test.go @@ -98,6 +98,53 @@ func TestConvertVolumeToMountNamedVolume(t *testing.T) { assert.Equal(t, expected, mount) } +func TestConvertVolumeToMountNamedVolumeWithNameCustomizd(t *testing.T) { + stackVolumes := volumes{ + "normal": composetypes.VolumeConfig{ + Name: "user_specified_name", + Driver: "vsphere", + DriverOpts: map[string]string{ + "opt": "value", + }, + Labels: map[string]string{ + "something": "labeled", + }, + }, + } + namespace := NewNamespace("foo") + expected := mount.Mount{ + Type: mount.TypeVolume, + Source: "user_specified_name", + Target: "/foo", + ReadOnly: true, + VolumeOptions: &mount.VolumeOptions{ + Labels: map[string]string{ + LabelNamespace: "foo", + "something": "labeled", + }, + DriverConfig: &mount.Driver{ + Name: "vsphere", + Options: map[string]string{ + "opt": "value", + }, + }, + NoCopy: true, + }, + } + config := composetypes.ServiceVolumeConfig{ + Type: "volume", + Source: "normal", + Target: "/foo", + ReadOnly: true, + Volume: &composetypes.ServiceVolumeVolume{ + NoCopy: true, + }, + } + mount, err := convertVolumeToMount(config, stackVolumes, namespace) + assert.NoError(t, err) + assert.Equal(t, expected, mount) +} + func TestConvertVolumeToMountNamedVolumeExternal(t *testing.T) { stackVolumes := volumes{ "outside": composetypes.VolumeConfig{ diff --git a/cli/compose/loader/full-example.yml b/cli/compose/loader/full-example.yml index 76087c57ba..347dbf5136 100644 --- a/cli/compose/loader/full-example.yml +++ b/cli/compose/loader/full-example.yml @@ -1,4 +1,4 @@ -version: "3.3" +version: "3.4" services: foo: @@ -280,6 +280,15 @@ volumes: foo: "bar" baz: 1 + another-volume: + name: "user_specified_name" + driver: vsphere + + driver_opts: + # Values can be strings or numbers + foo: "bar" + baz: 1 + external-volume: # Specifies that a pre-existing volume called "external-volume" # can be referred to within this file as "external-volume" @@ -288,5 +297,12 @@ volumes: other-external-volume: # Specifies that a pre-existing volume called "my-cool-volume" # can be referred to within this file as "other-external-volume" + # This example uses the deprecated "volume.external.name" (replaced by "volume.name") external: name: my-cool-volume + + external-volume3: + # Specifies that a pre-existing volume called "this-is-volume3" + # can be referred to within this file as "external-volume3" + name: this-is-volume3 + external: true diff --git a/cli/compose/loader/loader.go b/cli/compose/loader/loader.go index b456e1824d..2fb2630087 100644 --- a/cli/compose/loader/loader.go +++ b/cli/compose/loader/loader.go @@ -444,6 +444,12 @@ func LoadVolumes(source map[string]interface{}) (map[string]types.VolumeConfig, if volume.External.Name == "" { volume.External.Name = name volumes[name] = volume + } else { + logrus.Warnf("volume %s: volume.external.name is deprecated in favor of volume.name", name) + + if volume.Name != "" { + return nil, errors.Errorf("volume %s: volume.external.name and volume.name conflict; only use volume.name", name) + } } } } diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index 6a43e52121..231109a1e8 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -628,6 +628,22 @@ volumes: assert.Contains(t, err.Error(), "external_volume") } +func TestInvalidExternalNameAndNameCombination(t *testing.T) { + _, err := loadYAML(` +version: "3.4" +volumes: + external_volume: + name: user_specified_name + external: + name: external_name +`) + + assert.Error(t, err) + fmt.Println(err) + assert.Contains(t, err.Error(), "volume.external.name and volume.name conflict; only use volume.name") + assert.Contains(t, err.Error(), "external_volume") +} + func durationPtr(value time.Duration) *time.Duration { return &value } @@ -983,6 +999,14 @@ func TestFullExample(t *testing.T) { "baz": "1", }, }, + "another-volume": { + Name: "user_specified_name", + Driver: "vsphere", + DriverOpts: map[string]string{ + "foo": "bar", + "baz": "1", + }, + }, "external-volume": { External: types.External{ Name: "external-volume", @@ -995,6 +1019,13 @@ func TestFullExample(t *testing.T) { External: true, }, }, + "external-volume3": { + Name: "this-is-volume3", + External: types.External{ + Name: "external-volume3", + External: true, + }, + }, } assert.Equal(t, expectedVolumeConfig, config.Volumes) diff --git a/cli/compose/schema/bindata.go b/cli/compose/schema/bindata.go index cba2c1e17c..f5301bc5c9 100644 --- a/cli/compose/schema/bindata.go +++ b/cli/compose/schema/bindata.go @@ -152,7 +152,7 @@ func dataConfig_schema_v33Json() (*asset, error) { return a, nil } -var _dataConfig_schema_v34Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\xcd\x93\xdb\xa0\x15\xbf\xfb\xaf\xd0\x28\xb9\x65\x3f\x32\xd3\x4c\x67\x9a\x5b\x8f\x3d\xb5\xe7\xee\x38\x1a\x8c\x9e\x6d\xb2\x08\x08\x20\xef\x3a\x99\xfd\xdf\x3b\xfa\x34\x20\x10\xd8\xd6\x66\xb7\x6d\x4e\xbb\x96\x7e\x0f\x78\xdf\xef\x01\xfa\xb5\xca\xb2\xfc\xa3\xc2\x7b\xa8\x50\xfe\x35\xcb\xf7\x5a\x8b\xaf\xf7\xf7\xdf\x15\x67\xb7\xdd\xd3\x3b\x2e\x77\xf7\xa5\x44\x5b\x7d\xfb\xf9\xcb\x7d\xf7\xec\x43\x7e\xd3\xd0\x91\xb2\x21\xc1\x9c\x6d\xc9\xae\xe8\xde\x14\x87\xbf\xdc\x7d\xb9\x6b\xc8\x3b\x88\x3e\x0a\x68\x40\x7c\xf3\x1d\xb0\xee\x9e\x49\xf8\x51\x13\x09\x0d\xf1\x43\x7e\x00\xa9\x08\x67\xf9\xfa\x66\xd5\xbc\x13\x92\x0b\x90\x9a\x80\xca\xbf\x66\xcd\xe2\xb2\x6c\x84\x0c\x0f\x8c\x61\x95\x96\x84\xed\xf2\xf6\xf1\x4b\x3b\x42\x96\xe5\x0a\xe4\x81\x60\x63\x84\x71\xa9\x1f\xee\x4f\xe3\xdf\x8f\xb0\x1b\x77\x54\x63\xb1\xed\x73\x81\xb4\x06\xc9\xfe\x35\x5d\x5b\xfb\xfa\xdb\x03\xba\xfd\xf9\xf7\xdb\x7f\x7f\xbe\xfd\xdb\x5d\x71\xbb\xfe\xf4\xd1\x7a\xdd\xc8\x57\xc2\xb6\x9b\xbe\x84\x2d\x61\x44\x13\xce\xc6\xf9\xf3\x11\xf9\xd2\xff\xf7\x32\x4e\x8c\xca\xb2\x05\x23\x6a\xcd\xbd\x45\x54\x81\xcd\x33\x03\xfd\xc4\xe5\x63\x8c\xe7\x11\xf6\x46\x3c\xf7\xf3\x7b\x78\xb6\xd9\x39\x70\x5a\x57\x51\x0d\x0e\xa8\x37\x62\xa6\x9b\x7e\x19\xfd\x29\xc0\x12\x74\xdc\x64\x3b\xd4\x9b\x59\x6c\x33\xfd\x32\x0c\x77\x51\x23\xc6\xf0\x80\x7a\x23\x86\xbb\xe9\xaf\x63\x78\x35\x30\x3d\x8b\xed\x10\xc6\xdc\xed\x02\xad\x78\xe6\x13\x95\x2f\x9e\x84\x65\x35\x0a\x2b\x20\xa5\x12\x04\xe5\xc7\xe6\x59\x40\x1e\x1d\xa0\x02\xa6\xf3\x51\x04\x59\x96\x6f\x6a\x42\x4b\x57\xa2\x9c\xc1\x3f\x9b\x21\x1e\x8c\x87\x59\xf6\xcb\x0d\xdd\xc6\x38\xed\x7b\xeb\x57\x58\xe1\xe3\xfb\x00\x2f\xe3\x7b\xcc\x99\x86\x67\xdd\x32\x35\x3f\x75\x27\x02\x8e\x1f\x41\x6e\x09\x85\x54\x0a\x24\x3b\x2b\x0e\x88\x8c\x12\xa5\x0b\x2e\x8b\x92\x60\xed\xa5\xa7\x68\x03\xf4\xaa\x11\x30\xc2\x7b\x28\xb6\x92\x57\xd1\x51\xb6\x45\xc7\x89\xca\x5f\x9c\x71\x26\x03\xc7\x4d\x7b\x24\x35\x7e\xad\x57\x9e\x01\x73\x8c\x44\x81\xca\xd2\x12\x29\x92\x12\x1d\xf3\x9b\x2c\x27\x1a\x2a\xe5\x97\x76\x96\xd7\x8c\xfc\xa8\xe1\x1f\x3d\x44\xcb\x1a\xdc\x71\x4b\xc9\xc5\xf2\x03\xef\x24\xaf\x45\x21\x90\x6c\x6c\x7d\xde\x12\x72\xcc\xab\x0a\xb1\xa5\x1c\xe0\x1c\x3e\x12\x24\x3f\x09\xb3\x99\xe9\x55\xfd\x1c\xe6\xab\x71\x36\x6b\x59\x01\x6e\xe2\xfc\x4c\x5d\x3a\xee\xd4\x71\xb7\x6e\xa2\x22\xaf\x25\x4e\xf5\xd2\x66\x4e\x24\x77\x90\x1a\x07\xb2\x2c\xaf\x49\x99\x0e\xde\x9d\x03\xae\x78\x69\xaf\x9b\xd5\xd5\x06\xe4\xc4\x25\x6d\xcf\x9a\xfe\x5e\xaf\x7c\x6f\x1c\xed\x6b\x44\x18\xc8\x82\xa1\x2a\x26\xab\x1c\x4b\x28\x81\x69\x82\x68\xa1\x04\x60\x0b\x3e\x68\x6a\x46\x33\x79\x52\xd4\xcc\x25\xec\x88\xd2\xf2\xe8\x45\x9e\xb8\x30\x17\x56\x82\x00\x56\xaa\xa2\xeb\x01\x52\x03\x9c\x35\xc0\xd8\x10\x2c\x1a\x26\x4a\x36\x17\xb8\xbb\x61\x9a\xd0\xdd\xac\x2d\x77\x08\x0b\x05\x48\xe2\xfd\x85\xf4\xbc\x42\x84\xa5\x28\x15\x98\x96\x47\xc1\x49\x17\xc6\xde\x5d\x7c\x02\x76\x28\x46\xbb\x39\x5b\x0c\xc0\x0e\x44\x72\x56\x0d\x41\x3a\x2d\x81\x1a\xf4\xcf\x82\x2b\xb8\x3e\x38\xf6\x14\x0f\x03\xe3\x37\xa3\x4f\xaf\x6d\xe9\xe5\x5b\x2e\x2b\xd4\x2c\x76\x98\xdb\xf4\x61\x6b\xaa\xa9\xe5\x99\x02\x34\x79\x68\x0a\x5f\x44\x0b\x4a\xd8\xe3\xf2\x26\x0e\xcf\x5a\xa2\x62\xcf\x95\xbe\xa4\x46\xc9\xf7\x80\xa8\xde\xe3\x3d\xe0\xc7\x19\x72\x13\x65\x51\x73\xa5\x53\x8c\x9c\x54\x68\x17\x07\x09\x1c\x83\x5c\x5c\x8b\xe5\x8b\x0a\xdf\x18\x96\xef\x76\x0d\x34\x64\x71\x93\xda\xbe\x7f\x1d\xab\x8a\x4b\x49\x0e\x20\x53\x4b\x5c\x2e\x4e\x2d\x89\xfb\x32\x25\x9b\x47\xfb\x33\x0b\xfa\xed\xae\x6b\xcf\x66\xbc\xaa\xfd\x8f\xd2\x7c\x3d\x4d\x99\xd3\xa4\xe9\x3e\x71\x38\x4c\xab\x73\x2d\xad\x54\x08\x37\xe5\xac\x04\x15\xd0\xeb\x09\xda\x6f\x78\x14\x93\x9c\x7f\xc2\x4e\xc0\x93\xc4\x1a\x8a\xd4\x67\x27\xc2\xec\xa2\x0e\x2b\x49\x75\xd1\x16\x3b\xc2\x4d\x68\x79\xa9\xcb\x3c\x2d\x37\x6e\x62\x2d\x0e\x51\x82\x14\xc4\x9d\x3d\x28\x48\x6b\x34\x22\x0e\x5f\x12\x6d\xc2\x47\xfb\xd7\x59\xda\x00\x69\x70\xcc\xf4\xd6\x2d\x32\x94\x59\xa2\x52\xea\x5d\xc8\x3a\x5e\xb4\xbe\x66\x67\x29\xec\xc2\xdb\x8e\x15\x6d\x84\x30\x1d\x4c\x70\xa9\x7f\x4b\x2f\x74\x8a\x53\xa7\x84\xdf\x4d\x3e\x6d\x8f\x5c\x75\x27\x11\xbd\x4e\x4f\x35\x13\xa5\x3c\x68\x4f\x47\x45\x98\x86\x5d\xd3\xca\xf8\x93\x40\xbd\xa1\x44\xed\xa1\x3c\x87\x46\x72\xcd\x31\xa7\x69\x8e\xe1\xdd\xa0\x49\x77\x86\x99\xfe\xea\xa2\xda\x4c\x48\x72\x20\x14\x76\x0e\xc7\x1b\xce\x29\x20\x66\x25\x0a\x09\xa8\x2c\x38\xa3\xc7\x04\xa4\xd2\x48\x46\x77\x25\x14\xe0\x5a\x12\x7d\x2c\xb8\xd0\x8b\x57\x85\x6a\x5f\x15\x8a\xfc\x04\xdb\xf7\x4e\x56\xdf\x0f\xb4\x76\x16\xe4\x6c\x71\x67\x7f\xb6\x22\xfe\x6f\xb6\x22\xd4\x51\x61\x7d\x59\x6d\xad\x74\x49\x58\xc1\x05\xb0\xa8\x6f\x28\xcd\x45\xb1\x93\x08\x43\x21\x40\x12\xee\x15\x85\x15\x60\xcb\x5a\xa2\x66\xfe\xe9\x30\x8a\xec\x18\xf2\xc7\x1d\x03\xaa\x2b\xb1\xbd\x70\x13\x40\xeb\xb8\xb3\xd7\x94\x54\x24\xec\x34\x1e\xab\x4d\xa8\xd7\xba\x5a\xcd\x5f\xa2\xcd\x94\x67\x49\x21\x7b\xa6\x43\x98\x6f\x10\x12\x3a\x83\x3d\x92\x67\xa4\x8e\xd6\x31\xb7\x81\xfc\xe4\xeb\x1b\xbc\xeb\xb2\x0e\xab\xdb\xf1\x6e\xfa\x85\xac\xbd\xf8\xb3\x4a\x2f\x77\x19\xeb\x60\xf5\xe3\x77\xaa\x5a\x45\x9b\xb8\x16\xc3\xd4\x5c\x03\x32\x42\xa7\xa7\xae\xd9\x7f\x45\x84\xb6\x74\xd4\xc2\x3d\xba\x49\x88\xe3\xfd\x4c\x89\xb1\xf3\xb5\xa3\x7e\x72\x45\x60\xd0\x60\xce\x14\x51\x1a\x18\xf6\xef\xaf\x7a\x89\x36\x64\x72\x78\x31\x15\xca\x7c\xdf\x95\xd6\x75\xb5\x28\xb4\xeb\xe2\x6d\x72\xa3\x93\xee\xab\xfd\x81\xfc\x6f\x61\x85\x71\xcc\x45\x40\x35\xe9\x6c\x9c\x9b\x66\x9d\xad\x8b\x99\x3a\x34\x14\x32\x9e\xb8\x7c\x6c\x12\x52\x49\xfc\x91\x63\xe5\x90\x9c\x71\xa4\xef\xec\xf5\x0d\x03\xf8\xce\xaa\x4d\x68\xf4\x6c\x7f\xfe\xdc\xbc\x07\x05\xcf\xb4\x89\x42\x1b\xe7\x5c\xc2\x97\x68\x9b\xcc\x20\x0f\xf1\x7c\x2f\x41\x4b\xe2\x1c\x25\x0c\x45\x93\x99\xdb\x41\xbd\xcf\x0d\x77\x4d\x2a\xe0\xb5\x3f\x0c\xad\x4c\xc3\xe9\x89\x72\xe3\xcc\x3f\xa2\x54\x03\xe9\xea\xf4\xc1\x38\x40\xea\xfa\xf2\xa8\xe2\x52\x12\x16\xb0\xb2\x3d\xda\x48\xca\x6e\x12\x04\x25\x18\xa9\x58\x05\x71\xc5\x2e\x70\x2d\x4a\xa4\xa1\xe8\xaf\x8d\x9c\x53\xb3\xcd\x14\x6b\x02\x49\x44\x29\x50\xa2\xaa\x94\xe2\x27\x2f\x81\x22\x6f\xf4\x8f\xd6\xbd\x2d\xf9\x16\x11\x5a\x4b\x28\x10\x0e\x86\x69\x87\xa2\xe2\x8c\x68\xee\x0d\x27\x69\x53\x56\xe8\xb9\x18\xa6\x6d\x21\xb1\x96\xc4\xee\xc6\x53\x37\x70\x0d\x4b\xe8\x72\xf7\x79\x65\xf5\x8c\x8a\x4e\x45\x7a\xc0\x62\x86\x19\x27\xac\x4b\x50\x4d\xd8\x19\xf7\xd7\xa3\xf4\xd1\x00\xdf\x6f\x0f\x14\x82\x53\xd2\x55\x01\x4b\x70\x88\x39\xeb\x84\x9c\x62\x10\x57\x5a\x60\x63\x0e\x4d\x0f\x53\x09\x1d\x75\xd6\x96\xe0\x89\xb0\x92\x3f\x9d\x31\xe1\x72\xa6\x24\x28\xc2\xe0\x04\xc7\x6b\x05\xad\xb4\x44\x84\xe9\xb3\x8f\x93\x5c\xb1\x08\x09\x5b\x90\xc0\xa6\x86\x9e\xcd\x97\xf5\x59\xb8\xb4\x8f\xf1\x16\xe7\xb0\x47\x28\xd1\xd4\xb7\x6f\xb0\xab\x77\xad\xf2\xaf\x28\x90\x46\x2f\x8e\x24\xd2\x11\x17\x2d\x8d\x42\xc9\x13\x8b\x3a\x7a\x34\x55\x41\xc5\xe7\xaf\x61\x5c\x71\x11\x39\xc6\xe2\x00\x5b\xa0\x50\x48\x3a\xcb\xec\x51\x05\x17\xcb\x6f\xa6\xc4\xcf\x2b\xd7\xf1\xb0\x4d\x04\xaa\x96\x8a\x21\xc9\xa7\xbb\xb9\xb7\x52\xc9\xde\x41\x74\xa8\x37\x2c\xd0\x2b\xbf\xef\xe8\x60\xdf\x9c\x68\x2f\x66\x04\xb4\xfa\x30\xb6\x21\x37\xa3\xac\xd6\xc9\x2a\x0e\xde\x8a\x58\x6e\xfd\x6d\x47\xe4\xee\x80\xfa\x5a\x27\xa4\x35\xc2\xfb\xa4\x2e\xeb\xcc\xd2\xfa\x8a\x38\x34\xd9\x0b\xf0\x86\xa1\x1e\xf5\x27\x0a\xfd\x8f\xd8\xec\xef\xb3\xaf\xfe\x5b\x88\xe8\x9d\xfc\x16\x75\x71\x1e\x4f\xb8\x52\xf9\x0e\x74\xf6\xc6\xaa\x98\x24\x31\xaf\x2a\x7a\xd4\x1f\x55\xbc\xaa\x57\xd8\xa7\x5d\x86\x4a\xa6\x9b\x5f\x73\x92\x3c\xf7\x2b\x86\xb5\xbd\x0c\x17\xe6\xf9\x72\xd0\xae\x6b\xe6\xce\xc2\x07\x48\x60\xb3\xd5\x99\xb4\x17\xe2\x3c\xe7\x0b\xc6\xfd\xbb\x4f\x33\xd5\xdb\xdc\xd5\xb9\x57\x2a\x7b\x16\xb8\x67\xe0\xd7\xa9\xd3\x18\x0f\xd2\x9d\x7e\x1c\x15\xf6\xff\x81\x7e\xf2\xa9\x54\xc3\x27\x3b\x4e\x36\x67\x7f\xd9\x27\x4b\xdd\x67\x4e\x6b\x4b\x3e\x0e\xa4\xbb\x88\x6a\x24\xda\xb5\xb9\x57\x10\xbc\x39\xef\xfb\x80\xca\x3d\xd7\x1a\x3e\x64\x0a\x1c\xb5\xaf\xcc\xbf\xed\x47\x67\xab\x97\xd5\x7f\x02\x00\x00\xff\xff\x8b\xd2\x8d\x87\xde\x3b\x00\x00") +var _dataConfig_schema_v34Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x4b\x93\xdb\x2a\x16\xde\xfb\x57\xa8\x74\xef\x2e\xfd\x48\xd5\xa4\xa6\x6a\xb2\x9b\xe5\xac\x66\xd6\xd3\xe5\xa8\x30\x3a\xb6\x49\x23\x20\x80\xdc\xed\xa4\xfa\xbf\x4f\xe9\x69\x40\x20\xb0\xad\x4e\x77\xe6\x66\xd5\x6d\xe9\x3b\xc0\x79\x9f\x03\xe8\xc7\x2a\xcb\xf2\x3f\x15\xde\x43\x85\xf2\xcf\x59\xbe\xd7\x5a\x7c\xbe\xbf\xff\xaa\x38\xbb\xed\x9e\xde\x71\xb9\xbb\x2f\x25\xda\xea\xdb\x8f\x9f\xee\xbb\x67\x7f\xe4\x37\x0d\x1d\x29\x1b\x12\xcc\xd9\x96\xec\x8a\xee\x4d\x71\xf8\xdb\xdd\xa7\xbb\x86\xbc\x83\xe8\xa3\x80\x06\xc4\x37\x5f\x01\xeb\xee\x99\x84\x6f\x35\x91\xd0\x10\x3f\xe4\x07\x90\x8a\x70\x96\xaf\x6f\x56\xcd\x3b\x21\xb9\x00\xa9\x09\xa8\xfc\x73\xd6\x2c\x2e\xcb\x46\xc8\xf0\xc0\x18\x56\x69\x49\xd8\x2e\x6f\x1f\xbf\xb4\x23\x64\x59\xae\x40\x1e\x08\x36\x46\x18\x97\xfa\xc7\xfd\x69\xfc\xfb\x11\x76\xe3\x8e\x6a\x2c\xb6\x7d\x2e\x90\xd6\x20\xd9\x7f\xa6\x6b\x6b\x5f\x7f\x79\x40\xb7\xdf\xff\x79\xfb\xdf\x8f\xb7\xff\xb8\x2b\x6e\xd7\x1f\xfe\xb4\x5e\x37\xf2\x95\xb0\xed\xa6\x2f\x61\x4b\x18\xd1\x84\xb3\x71\xfe\x7c\x44\xbe\xf4\xff\xbd\x8c\x13\xa3\xb2\x6c\xc1\x88\x5a\x73\x6f\x11\x55\x60\xf3\xcc\x40\x3f\x71\xf9\x18\xe3\x79\x84\xbd\x11\xcf\xfd\xfc\x1e\x9e\x6d\x76\x0e\x9c\xd6\x55\x54\x83\x03\xea\x8d\x98\xe9\xa6\x5f\x46\x7f\x0a\xb0\x04\x1d\x37\xd9\x0e\xf5\x66\x16\xdb\x4c\xbf\x0c\xc3\x5d\xd4\x88\x31\x3c\xa0\xde\x88\xe1\x6e\xfa\xeb\x18\x5e\x0d\x4c\xcf\x62\x3b\x84\x31\x77\xbb\x40\x2b\x9e\xf9\x44\xe5\x8b\x27\x61\x59\x8d\xc2\x0a\x48\xa9\x04\x41\xf9\xb1\x79\x16\x90\x47\x07\xa8\x80\xe9\x7c\x14\x41\x96\xe5\x9b\x9a\xd0\xd2\x95\x28\x67\xf0\xef\x66\x88\x07\xe3\x61\x96\xfd\x70\x43\xb7\x31\x4e\xfb\xde\xfa\x15\x56\xf8\xf8\x3e\xc0\xcb\xf8\x1e\x73\xa6\xe1\x59\xb7\x4c\xcd\x4f\xdd\x89\x80\xe3\x47\x90\x5b\x42\x21\x95\x02\xc9\xce\x8a\x03\x22\xa3\x44\xe9\x82\xcb\xa2\x24\x58\x7b\xe9\x29\xda\x00\xbd\x6a\x04\x8c\xf0\x1e\x8a\xad\xe4\x55\x74\x94\x6d\xd1\x71\xa2\xf2\x17\x67\x9c\xc9\xc0\x71\xd3\x1e\x49\x8d\x5f\xeb\x95\x67\xc0\x1c\x23\x51\xa0\xb2\xb4\x44\x8a\xa4\x44\xc7\xfc\x26\xcb\x89\x86\x4a\xf9\xa5\x9d\xe5\x35\x23\xdf\x6a\xf8\x57\x0f\xd1\xb2\x06\x77\xdc\x52\x72\xb1\xfc\xc0\x3b\xc9\x6b\x51\x08\x24\x1b\x5b\x9f\xb7\x84\x1c\xf3\xaa\x42\x6c\x29\x07\x38\x87\x8f\x04\xc9\x4f\xc2\x6c\x66\x7a\x55\x3f\x87\xf9\x6a\x9c\xcd\x5a\x56\x80\x9b\x38\x3f\x53\x97\x8e\x3b\x75\xdc\xad\x9b\xa8\xc8\x6b\x89\x53\xbd\xb4\x99\x13\xc9\x1d\xa4\xc6\x81\x2c\xcb\x6b\x52\xa6\x83\x77\xe7\x80\x2b\x5e\xda\xeb\x66\x75\xb5\x01\x39\x71\x49\xdb\xb3\xa6\xbf\xd7\x2b\xdf\x1b\x47\xfb\x1a\x11\x06\xb2\x60\xa8\x8a\xc9\x2a\xc7\x12\x4a\x60\x9a\x20\x5a\x28\x01\xd8\x82\x0f\x9a\x9a\xd1\x4c\x9e\x14\x35\x73\x09\x3b\xa2\xb4\x3c\x7a\x91\x27\x2e\xcc\x85\x95\x20\x80\x95\xaa\xe8\x7a\x80\xd4\x00\x67\x0d\x30\x36\x04\x8b\x86\x89\x92\xcd\x05\xee\x6e\x98\x26\x74\x37\x6b\xcb\x1d\xc2\x42\x01\x92\x78\x7f\x21\x3d\xaf\x10\x61\x29\x4a\x05\xa6\xe5\x51\x70\xd2\x85\xb1\x77\x17\x9f\x80\x1d\x8a\xd1\x6e\xce\x16\x03\xb0\x03\x91\x9c\x55\x43\x90\x4e\x4b\xa0\x06\xfd\xb3\xe0\x0a\xae\x0f\x8e\x3d\xc5\xc3\xc0\xf8\xcd\xe8\xd3\x6b\x5b\x7a\xf9\x96\xcb\x0a\x35\x8b\x1d\xe6\x36\x7d\xd8\x9a\x6a\x6a\x79\xa6\x00\x4d\x1e\x9a\xc2\x17\xd1\x82\x12\xf6\xb8\xbc\x89\xc3\xb3\x96\xa8\xd8\x73\xa5\x2f\xa9\x51\xf2\x3d\x20\xaa\xf7\x78\x0f\xf8\x71\x86\xdc\x44\x59\xd4\x5c\xe9\x14\x23\x27\x15\xda\xc5\x41\x02\xc7\x20\x17\xd7\x62\xf9\xa2\xc2\x37\x86\xe5\xbb\x5d\x03\x0d\x59\xdc\xa4\xb6\xef\x5f\xc7\xaa\xe2\x52\x92\x03\xc8\xd4\x12\x97\x8b\x53\x4b\xe2\xbe\x4c\xc9\xe6\xd1\xfe\xcc\x82\x7e\xb9\xeb\xda\xb3\x19\xaf\x6a\xff\xa3\x34\x5f\x4f\x53\xe6\x34\x69\xba\x4f\x1c\x0e\xd3\xea\x5c\x4b\x2b\x15\xc2\x4d\x39\x2b\x41\x05\xf4\x7a\x82\xf6\x1b\x1e\xc5\x24\xe7\x9f\xb0\x13\xf0\x24\xb1\x86\x22\xf5\xd9\x89\x30\xbb\xa8\xc3\x4a\x52\x5d\xb4\xc5\x8e\x70\x13\x5a\x5e\xea\x32\x4f\xcb\x8d\x9b\x58\x8b\x43\x94\x20\x05\x71\x67\x0f\x0a\xd2\x1a\x8d\x88\xc3\xa7\x44\x9b\xf0\xd1\xfe\x7d\x96\x36\x40\x1a\x1c\x33\xbd\x75\x8b\x0c\x65\x96\xa8\x94\x7a\x17\xb2\x8e\x17\xad\xaf\xd9\x59\x0a\xbb\xf0\xb6\x63\x45\x1b\x21\x4c\x07\x13\x5c\xea\x9f\xd2\x0b\x9d\xe2\xd4\x29\xe1\x77\x93\x4f\xdb\x23\x57\xdd\x49\x44\xaf\xd3\x53\xcd\x44\x29\x0f\xda\xd3\x51\x11\xa6\x61\xd7\xb4\x32\xfe\x24\x50\x6f\x28\x51\x7b\x28\xcf\xa1\x91\x5c\x73\xcc\x69\x9a\x63\x78\x37\x68\xd2\x9d\x61\xa6\xbf\xba\xa8\x36\x13\x92\x1c\x08\x85\x9d\xc3\xf1\x86\x73\x0a\x88\x59\x89\x42\x02\x2a\x0b\xce\xe8\x31\x01\xa9\x34\x92\xd1\x5d\x09\x05\xb8\x96\x44\x1f\x0b\x2e\xf4\xe2\x55\xa1\xda\x57\x85\x22\xdf\xc1\xf6\xbd\x93\xd5\xf7\x03\xad\x9d\x05\x39\x5b\xdc\xd9\xef\xad\x88\xbf\xcc\x56\x84\x3a\x2a\xac\x2f\xab\xad\x95\x2e\x09\x2b\xb8\x00\x16\xf5\x0d\xa5\xb9\x28\x76\x12\x61\x28\x04\x48\xc2\xbd\xa2\xb0\x02\x6c\x59\x4b\xd4\xcc\x3f\x1d\x46\x91\x1d\x43\xfe\xb8\x63\x40\x75\x25\xb6\x17\x6e\x02\x68\x1d\x77\xf6\x9a\x92\x8a\x84\x9d\xc6\x63\xb5\x09\xf5\x5a\x57\xab\xf9\x4b\xb4\x99\xf2\x2c\x29\x64\xcf\x74\x08\xf3\x0d\x42\x42\x67\xb0\x47\xf2\x8c\xd4\xd1\x3a\xe6\x36\x90\x9f\x7c\x7d\x83\x77\x5d\xd6\x61\x75\x3b\xde\x4d\xbf\x90\xb5\x17\x7f\x56\xe9\xe5\x2e\x63\x1d\xac\x7e\xfc\x4e\x55\xab\x68\x13\xd7\x62\x98\x9a\x6b\x40\x46\xe8\xf4\xd4\x35\xfb\x25\x22\xb4\xa5\xa3\x16\xee\xd1\x4d\x42\x1c\xef\x67\x4a\x8c\x9d\xaf\x1d\xf5\x93\x2b\x02\x83\x06\x73\xa6\x88\xd2\xc0\xb0\x7f\x7f\xd5\x4b\xb4\x21\x93\xc3\x8b\xa9\x50\xe6\xfb\xae\xb4\xae\xab\x45\xa1\x5d\x17\x6f\x93\x1b\x9d\x74\x5f\xed\x0f\xe4\x7f\x0a\x2b\x8c\x63\x2e\x02\xaa\x49\x67\xe3\xdc\x34\xeb\x6c\x5d\xcc\xd4\xa1\xa1\x90\xf1\xc4\xe5\x63\x93\x90\x4a\xe2\x8f\x1c\x2b\x87\xe4\x8c\x23\x7d\x67\xaf\x6f\x18\xc0\x77\x56\x6d\x42\xa3\x67\xfb\xf3\xe7\xe6\x3d\x28\x78\xa6\x4d\x14\xda\x38\xe7\x12\xbe\x44\xdb\x64\x06\x79\x88\xe7\x7b\x09\x5a\x12\xe7\x28\x61\x28\x9a\xcc\xdc\x0e\xea\x7d\x6e\xb8\x6b\x52\x01\xaf\xfd\x61\x68\x65\x1a\x4e\x4f\x94\x1b\x67\xfe\x11\xa5\x1a\x48\x57\xa7\x0f\xc6\x01\x52\xd7\x97\x47\x15\x97\x92\xb0\x80\x95\xed\xd1\x46\x52\x76\x93\x20\x28\xc1\x48\xc5\x2a\x88\x2b\x76\x81\x6b\x51\x22\x0d\x45\x7f\x6d\xe4\x9c\x9a\x6d\xa6\x58\x13\x48\x22\x4a\x81\x12\x55\xa5\x14\x3f\x79\x09\x14\x79\xa3\x7f\xb4\xee\x6d\xc9\xb7\x88\xd0\x5a\x42\x81\x70\x30\x4c\x3b\x14\x15\x67\x44\x73\x6f\x38\x49\x9b\xb2\x42\xcf\xc5\x30\x6d\x0b\x89\xb5\x24\x76\x37\x9e\xba\x81\x6b\x58\x42\x97\xbb\xcf\x2b\xab\x67\x54\x74\x2a\xd2\x03\x16\x33\xcc\x38\x61\x5d\x82\x6a\xc2\xce\xb8\xbf\x1e\xa5\x8f\x06\xf8\x7e\x7b\xa0\x10\x9c\x92\xae\x0a\x58\x82\x43\xcc\x59\x27\xe4\x14\x83\xb8\xd2\x02\x1b\x73\x68\x7a\x98\x4a\xe8\xa8\xb3\xb6\x04\x4f\x84\x95\xfc\xe9\x8c\x09\x97\x33\x25\x41\x11\x06\x27\x38\x5e\x2b\x68\xa5\x25\x22\x4c\x9f\x7d\x9c\xe4\x8a\x45\x48\xd8\x82\x04\x36\x35\xf4\x6c\xbe\xac\xcf\xc2\xa5\x7d\x8c\xb7\x38\x87\x3d\x42\x89\xa6\xbe\x7d\x83\x5d\xbd\x6b\x95\x7f\x45\x81\x34\x7a\x71\x24\x91\x8e\xb8\x68\x69\x14\x4a\x9e\x58\xd4\xd1\xa3\xa9\x0a\x2a\x3e\x7f\x0d\xe3\x8a\x8b\xc8\x31\x16\x07\xd8\x02\x85\x42\xd2\x59\x66\x8f\x2a\xb8\x58\x7e\x33\x25\x7e\x5e\xb9\x8e\x87\x6d\x22\x50\xb5\x54\x0c\x49\x3e\xdd\xcd\xbd\x95\x4a\xf6\x0e\xa2\x43\xbd\x61\x81\x5e\xf9\x7d\x47\x07\xfb\xe6\x44\x7b\x31\x23\xa0\xd5\x87\xb1\x0d\xb9\x19\x65\xb5\x4e\x56\x71\xf0\x56\xc4\x72\xeb\x6f\x3b\x22\x77\x07\xd4\xd7\x3a\x21\xad\x11\xde\x27\x75\x59\x67\x96\xd6\x57\xc4\xa1\xc9\x5e\x80\x37\x0c\xf5\xa8\x05\xa2\x50\xca\x35\x95\xff\x8f\x48\xf5\xab\xdb\xf5\xcf\xb3\xc1\xfe\x7b\x89\xe8\xbd\xfd\x16\x75\x71\xae\x4f\xb8\x76\xf9\x0e\x74\xf6\xc6\xaa\x98\x24\x3a\xaf\x2a\x7a\xd4\x6f\x55\xbc\xaa\x57\xd8\x27\x62\x86\x4a\xa6\x1b\x64\x73\x92\x3c\xf7\x4b\x87\xb5\xbd\x0c\x17\xe6\xf9\xba\xd0\xae\x7d\xe6\xce\xcb\x07\x48\x60\x43\xd6\x99\xb4\x17\xe2\x3c\xe7\x0b\xc6\xfd\xbb\x0f\x33\x15\xde\xdc\xf5\xba\x57\x2a\x8d\x16\xb8\x8b\xe0\xd7\xa9\xd3\x3c\x0f\xd2\x9d\x7e\x40\x15\xf6\xff\x81\x7e\xf2\x39\x55\xc3\x27\x3b\x4e\x36\x70\x7f\xd8\xa7\x4f\xdd\xa7\x50\x6b\x4b\x3e\x0e\xa4\xbb\xac\x6a\x24\xda\xb5\xb9\x9f\x10\xbc\x5d\xef\xfb\xc8\xca\x3d\xfb\x1a\x3e\x76\x0a\x1c\xc7\xaf\xcc\xbf\xed\x87\x69\xab\x97\xd5\xff\x02\x00\x00\xff\xff\xa6\x9f\xe0\x94\x02\x3c\x00\x00") func dataConfig_schema_v34JsonBytes() ([]byte, error) { return bindataRead( diff --git a/cli/compose/schema/data/config_schema_v3.4.json b/cli/compose/schema/data/config_schema_v3.4.json index 2457a2de81..4cfbd060a2 100644 --- a/cli/compose/schema/data/config_schema_v3.4.json +++ b/cli/compose/schema/data/config_schema_v3.4.json @@ -437,6 +437,7 @@ "id": "#/definitions/volume", "type": ["object", "null"], "properties": { + "name": {"type": "string"}, "driver": {"type": "string"}, "driver_opts": { "type": "object", diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index 1eecc124f6..918c9bef0c 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -305,6 +305,7 @@ type IPAMPool struct { // VolumeConfig for a volume type VolumeConfig struct { + Name string Driver string DriverOpts map[string]string `mapstructure:"driver_opts"` External External @@ -313,6 +314,7 @@ type VolumeConfig struct { // External identifies a Volume or Network as a reference to a resource that is // not managed, and should already exist. +// External.name is deprecated and replaced by Volume.name type External struct { Name string External bool