From 4f7f3d2f615d8d83885ae822b36beabd6b361266 Mon Sep 17 00:00:00 2001 From: Ilya Sotkov Date: Wed, 22 Nov 2017 13:18:05 +0200 Subject: [PATCH] Add secret.name and config.name in compose. Signed-off-by: Ilya Sotkov --- cli/compose/convert/compose.go | 14 +++++++- cli/compose/convert/service.go | 12 +++---- cli/compose/loader/loader.go | 33 +++++++++++++++---- cli/compose/schema/bindata.go | 31 +++++++++++++---- .../schema/data/config_schema_v3.5.json | 2 ++ cli/compose/types/types.go | 1 + 6 files changed, 73 insertions(+), 20 deletions(-) diff --git a/cli/compose/convert/compose.go b/cli/compose/convert/compose.go index 699c7b852b..b9c1f4f760 100644 --- a/cli/compose/convert/compose.go +++ b/cli/compose/convert/compose.go @@ -101,6 +101,12 @@ func Secrets(namespace Namespace, secrets map[string]composetypes.SecretConfig) continue } + if secret.Name != "" { + name = secret.Name + } else { + name = namespace.Scope(name) + } + obj, err := fileObjectConfig(namespace, name, composetypes.FileObjectConfig(secret)) if err != nil { return nil, err @@ -118,6 +124,12 @@ func Configs(namespace Namespace, configs map[string]composetypes.ConfigObjConfi continue } + if config.Name != "" { + name = config.Name + } else { + name = namespace.Scope(name) + } + obj, err := fileObjectConfig(namespace, name, composetypes.FileObjectConfig(config)) if err != nil { return nil, err @@ -140,7 +152,7 @@ func fileObjectConfig(namespace Namespace, name string, obj composetypes.FileObj return swarmFileObject{ Annotations: swarm.Annotations{ - Name: namespace.Scope(name), + Name: name, Labels: AddStackLabel(namespace, obj.Labels), }, Data: data, diff --git a/cli/compose/convert/service.go b/cli/compose/convert/service.go index e180307047..3c9a6a661a 100644 --- a/cli/compose/convert/service.go +++ b/cli/compose/convert/service.go @@ -258,14 +258,14 @@ func convertServiceSecrets( refs := []*swarm.SecretReference{} lookup := func(key string) (composetypes.FileObjectConfig, error) { - configSpec, exists := secretSpecs[key] + secretSpec, exists := secretSpecs[key] if !exists { return composetypes.FileObjectConfig{}, errors.Errorf("undefined secret %q", key) } - return composetypes.FileObjectConfig(configSpec), nil + return composetypes.FileObjectConfig(secretSpec), nil } - for _, config := range secrets { - obj, err := convertFileObject(namespace, composetypes.FileReferenceConfig(config), lookup) + for _, secret := range secrets { + obj, err := convertFileObject(namespace, composetypes.FileReferenceConfig(secret), lookup) if err != nil { return nil, err } @@ -353,8 +353,8 @@ func convertFileObject( } source := namespace.Scope(config.Source) - if obj.External.External { - source = obj.External.Name + if obj.Name != "" { + source = obj.Name } uid := config.UID diff --git a/cli/compose/loader/loader.go b/cli/compose/loader/loader.go index 378e8d0ed5..92dde7f535 100644 --- a/cli/compose/loader/loader.go +++ b/cli/compose/loader/loader.go @@ -490,7 +490,7 @@ func LoadSecrets(source map[string]interface{}, details types.ConfigDetails) (ma return secrets, err } for name, secret := range secrets { - obj, err := loadFileObjectConfig(name, types.FileObjectConfig(secret), details) + obj, err := loadFileObjectConfig(name, "secret", types.FileObjectConfig(secret), details) if err != nil { return nil, err } @@ -507,7 +507,7 @@ func LoadConfigObjs(source map[string]interface{}, details types.ConfigDetails) return configs, err } for name, config := range configs { - obj, err := loadFileObjectConfig(name, types.FileObjectConfig(config), details) + obj, err := loadFileObjectConfig(name, "config", types.FileObjectConfig(config), details) if err != nil { return nil, err } @@ -516,13 +516,32 @@ func LoadConfigObjs(source map[string]interface{}, details types.ConfigDetails) return configs, nil } -func loadFileObjectConfig(name string, obj types.FileObjectConfig, details types.ConfigDetails) (types.FileObjectConfig, error) { - if obj.External.External && obj.External.Name == "" { - obj.External.Name = name - } - if obj.File != "" { +func loadFileObjectConfig(name string, objType string, obj types.FileObjectConfig, details types.ConfigDetails) (types.FileObjectConfig, error) { + // if "external: true" + if obj.External.External { + // handle deprecated external.name + if obj.External.Name != "" { + if obj.Name != "" { + return obj, errors.Errorf("%[1]s %[2]s: %[1]s.external.name and %[1]s.name conflict; only use %[1]s.name", objType, name) + } + if versions.GreaterThanOrEqualTo(details.Version, "3.5") { + logrus.Warnf("%[1]s %[2]s: %[1]s.external.name is deprecated in favor of %[1]s.name", objType, name) + } + obj.Name = obj.External.Name + obj.External.Name = "" + } else { + if obj.Name == "" { + obj.Name = name + } + } + // if not "external: true" + } else { + if obj.File == "" { + return obj, errors.Errorf("%[1]s %[2]s: specify a file or \"external: true\"", objType, name) + } obj.File = absPath(details.WorkingDir, obj.File) } + return obj, nil } diff --git a/cli/compose/schema/bindata.go b/cli/compose/schema/bindata.go index 5f150e13e7..616f7cb7ab 100644 --- a/cli/compose/schema/bindata.go +++ b/cli/compose/schema/bindata.go @@ -88,7 +88,7 @@ func dataConfig_schema_v30Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "data/config_schema_v3.0.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + info := bindataFileInfo{name: "data/config_schema_v3.0.json", size: 11063, mode: os.FileMode(420), modTime: time.Unix(1509949700, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -108,7 +108,7 @@ func dataConfig_schema_v31Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "data/config_schema_v3.1.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + info := bindataFileInfo{name: "data/config_schema_v3.1.json", size: 12209, mode: os.FileMode(420), modTime: time.Unix(1509949700, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -128,7 +128,7 @@ func dataConfig_schema_v32Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "data/config_schema_v3.2.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + info := bindataFileInfo{name: "data/config_schema_v3.2.json", size: 13708, mode: os.FileMode(420), modTime: time.Unix(1509949700, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -148,7 +148,7 @@ func dataConfig_schema_v33Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "data/config_schema_v3.3.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + info := bindataFileInfo{name: "data/config_schema_v3.3.json", size: 15367, mode: os.FileMode(420), modTime: time.Unix(1509949700, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -168,7 +168,27 @@ func dataConfig_schema_v34Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "data/config_schema_v3.4.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + info := bindataFileInfo{name: "data/config_schema_v3.4.json", size: 15750, mode: os.FileMode(420), modTime: time.Unix(1509979293, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _dataConfig_schema_v35Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\xcf\x72\xdb\xbc\x11\xbf\xeb\x29\x38\xfc\xbe\x5b\x24\x3b\x33\x4d\x3b\xd3\xdc\x7a\xec\xa9\x3d\xd7\xa3\x70\x20\x70\x25\x21\x06\x01\x64\x01\xca\x56\x32\x7e\xf7\x0e\xff\x8a\x04\x41\x02\x94\xe8\xd8\x69\x73\xb2\x45\xee\x2e\xb0\x8b\xdd\xdf\xee\x02\xe0\x8f\x55\x14\xc5\x7f\x6a\x7a\x84\x8c\xc4\x9f\xa3\xf8\x68\x8c\xfa\x7c\x7f\xff\x55\x4b\xb1\xa9\x9e\xde\x49\x3c\xdc\xa7\x48\xf6\x66\xf3\xf1\xd3\x7d\xf5\xec\x8f\x78\x5d\xf0\xb1\xb4\x60\xa1\x52\xec\xd9\x21\xa9\xde\x24\xa7\xbf\xdc\xfd\xf5\xae\x60\xaf\x48\xcc\x59\x41\x41\x24\x77\x5f\x81\x9a\xea\x19\xc2\xb7\x9c\x21\x14\xcc\x0f\xf1\x09\x50\x33\x29\xe2\xed\x7a\x55\xbc\x53\x28\x15\xa0\x61\xa0\xe3\xcf\x51\x31\xb9\x28\x6a\x49\x9a\x07\x1d\xb1\xda\x20\x13\x87\xb8\x7c\xfc\x52\x4a\x88\xa2\x58\x03\x9e\x18\xed\x48\x68\xa7\xfa\xc7\xfd\x45\xfe\x7d\x4b\xb6\xb6\xa5\x76\x26\x5b\x3e\x57\xc4\x18\x40\xf1\xef\xe1\xdc\xca\xd7\x5f\x1e\xc8\xe6\xfb\x3f\x36\xff\xf9\xb8\xf9\xfb\x5d\xb2\xd9\x7e\xf8\xb3\xf7\xba\xb0\x2f\xc2\xbe\x1a\x3e\x85\x3d\x13\xcc\x30\x29\xda\xf1\xe3\x96\xf2\xa5\xfe\xef\xa5\x1d\x98\xa4\x69\x49\x4c\x78\x6f\xec\x3d\xe1\x1a\xfa\x3a\x0b\x30\x4f\x12\x1f\x7d\x3a\xb7\x64\x6f\xa4\x73\x3d\xbe\x43\xe7\xbe\x3a\x27\xc9\xf3\xcc\xbb\x82\x0d\xd5\x1b\x29\x53\x0d\xbf\xcc\xfa\x69\xa0\x08\xc6\xef\xb2\x15\xd5\x9b\x79\x6c\x31\xfc\x32\x0a\x57\xa8\xe1\x53\xb8\xa1\x7a\x23\x85\xab\xe1\x6f\x53\x78\xd5\x28\xed\x9e\x63\xfc\xe5\x79\x53\xfc\x7d\x29\x65\x4e\xca\xab\xa4\x74\xe6\x57\x2a\xd1\xc3\x3c\x97\x39\x5d\x98\x33\x6e\xcf\xd6\xa0\x23\x96\x4c\x41\x71\x79\x2e\x67\xee\xb6\x59\x45\x90\x81\x30\x71\x6b\xa6\x28\x8a\x77\x39\xe3\xa9\x6d\x75\x29\xe0\x5f\x85\x88\x87\xce\xc3\x28\xfa\x61\xc3\x7b\x47\x4e\xf9\xbe\xf7\x6b\xdc\x29\xda\xf7\x23\xba\xb4\xef\xa9\x14\x06\x9e\x4d\xa9\xd4\xf4\xd0\x95\x09\x24\x7d\x04\xdc\x33\x0e\xa1\x1c\x04\x2b\x4f\x1f\x31\x19\x67\xda\x24\x12\x93\x94\x51\xe3\xe4\xe7\x64\x07\xfc\x26\x09\x94\xd0\x23\x24\x7b\x94\x99\x57\xca\x3e\xa9\x34\xd1\x4e\x41\x0d\x82\x07\x6a\x6e\x08\x1e\xc0\x6d\x59\x8b\x78\xc0\xed\x8f\xad\x96\xb5\xf3\x6b\xbb\x72\x08\x8c\x29\x51\x09\x49\xd3\xde\x3c\x08\x22\x39\xc7\xeb\x28\x66\x06\x32\xed\x56\x28\x8a\x73\xc1\xbe\xe5\xf0\xcf\x9a\xc4\x60\x0e\xb6\xdc\x14\xa5\x5a\x5e\xf0\x01\x65\xae\x12\x45\xb0\x08\xa4\x69\x63\xc7\x54\x66\x19\x11\x4b\x45\xd7\x1c\x3d\x02\x2c\x3f\xc0\xf9\xa8\x1b\xb2\xf5\x18\xdd\x57\xed\x68\xbd\x69\x8d\x68\xe3\xd7\x67\x88\x17\x7e\xc4\xf0\x63\x46\x01\xb9\x32\x47\x1a\x0a\x01\xd3\xa1\xe0\xa4\xcf\x59\x1a\x4e\x7c\x98\x43\x9c\xc9\xb4\x3f\x6f\x91\x67\x3b\xc0\x41\x48\xf6\x23\x6b\xf8\x7b\xbb\x72\xbd\xb1\x56\xdf\x10\x26\x00\x13\x41\x32\x9f\xad\x62\x8a\x90\x82\x30\x8c\xf0\x44\x2b\xa0\x3d\xf2\x66\xa5\x26\x56\x26\x0e\x82\xe4\x18\xe1\xc0\xb4\xc1\xf3\x34\x28\xbd\x74\x27\x96\x82\x02\x91\xea\xa4\x6a\x42\xe6\xa3\x67\x9c\x42\xdb\x91\x2c\x0a\x13\xa9\x98\xca\x0a\x95\x98\x22\x2f\x14\x73\x8b\x2d\xc6\x44\x03\x41\x7a\xbc\x92\x5f\x66\x84\x89\x90\x45\x05\x61\xf0\xac\x24\xab\x60\xec\xdd\xe1\x13\x88\x53\xd2\xfa\xcd\x6c\x33\x80\x38\x31\x94\x22\x6b\x40\x3a\x2c\x3b\x77\xf8\x9f\x95\xd4\x70\x3b\x38\xd6\x1c\x0f\x8d\xe2\xeb\x36\xa6\xb7\x7d\xeb\xc5\x7b\x89\x19\x29\x26\xdb\x8c\xdd\x8d\xe1\xde\x50\x43\xcf\xeb\x1a\xb0\xab\x43\x51\xd5\x12\x9e\x70\x26\x1e\x97\x77\x71\x78\x36\x48\x92\xa3\xd4\xe6\x9a\x02\x28\x3e\x02\xe1\xe6\x48\x8f\x40\x1f\x27\xd8\xbb\x54\x3d\x6e\xa9\x4d\x88\x93\xb3\x8c\x1c\xfc\x44\x8a\xfa\x48\xae\x2e\xf4\xe2\x45\x8d\xdf\x11\x2b\x0f\x87\x82\x74\xcc\xe3\x06\x8d\x43\xfd\xda\x57\x72\xa7\xc8\x4e\x80\xa1\x55\xa4\x54\x97\x7e\xc7\x7e\x19\x92\xcd\xbd\x0d\x62\x8f\xf4\xcb\x5d\xd5\x1f\x4e\x44\x55\xf9\x1f\xe7\xf1\x76\x98\x32\x87\x49\xd3\x7e\x62\x69\x18\x56\xe7\xf6\x56\x25\x23\xb4\x28\x67\x11\xf4\xc8\xba\x5e\x48\xeb\x7a\x3d\x19\xe4\xfc\x0b\xed\x80\x78\x90\x58\xc7\x90\xfa\xaa\x36\x62\x7e\xfb\x16\xb4\x74\xde\x1e\xdf\xa3\xcd\xd8\xf4\x42\xa7\x79\x99\xae\xdf\xc5\x4a\x3a\xc2\x19\xd1\xe0\x0f\xf6\xc9\x7e\xac\x95\xc6\xd4\xe9\x53\xa0\x4f\xb8\x78\xff\x36\xc9\x3b\xc2\x3a\x2a\x33\xbc\x75\xf3\x88\xea\x96\xa8\x9c\x3b\x27\xb2\xf5\x17\xad\xaf\xd9\x59\xaa\x7e\xe1\xdd\xc7\x8a\x12\x21\xba\x01\xa6\x24\x9a\x9f\xd2\x0b\x5d\x70\xea\x92\xf0\xab\xc1\x87\xed\x91\xbd\xdc\x41\x4c\xaf\xd3\x53\x4d\xa0\x94\x83\xda\xd1\x51\x31\x61\xe0\x50\xb4\x32\xee\x24\x90\xef\x38\xd3\x47\x48\xe7\xf0\xa0\x34\x92\x4a\x1e\x16\x18\xce\xdd\x9f\xf0\x60\x98\xe8\xaf\xae\xaa\xcd\x14\xb2\x13\xe3\x70\xb0\x34\xde\x49\xc9\x81\x88\x5e\xa2\x40\x20\x69\x22\x05\x3f\x07\x50\x6a\x43\xd0\xbb\x2b\xa1\x81\xe6\xc8\xcc\x39\x91\xca\x2c\x5e\x15\xea\x63\x96\x68\xf6\x1d\xfa\xb1\x77\xf1\xfa\x5a\xd0\xd6\x9a\x90\xb5\xc7\x1e\xfd\xde\x8a\xf8\xbf\xd9\x8a\xd0\x67\x4d\xcd\x75\xb5\xb5\x36\x29\x13\x89\x54\x20\xbc\xb1\xa1\x8d\x54\xc9\x01\x09\x85\x44\x01\x32\xe9\x34\x45\x0f\x60\xd3\x1c\x49\x31\xfe\x50\x8c\x66\x07\x41\xdc\xb8\xd3\x21\x35\x99\xda\x5f\xb9\x09\x60\x8c\x3f\xd8\x73\xce\x32\x36\x1e\x34\x0e\xaf\x0d\xa8\xd7\xaa\x5a\xcd\x5d\xa2\x4d\x94\x67\x41\x90\x3d\xd1\x21\x4c\x37\x08\x01\x9d\xc1\x91\xe0\x8c\xd4\x51\x06\xe6\x7e\x24\x3f\xb9\xfa\x06\xe7\xbc\x7a\xa7\xe5\xa5\xbc\x75\x3d\x91\xad\x93\x7e\x56\xe9\x65\x4f\x63\x3b\x5a\xfd\xb8\x83\x2a\xd7\xde\x26\xae\xa4\x11\x7a\xaa\x01\x69\x49\x87\xc7\xbe\xd1\x2f\x81\xd0\xbd\x35\x2a\xc9\x1d\x6b\x13\x80\xe3\xf5\x48\x81\xd8\xf9\xda\xa8\x1f\x5c\x11\x74\x78\xa8\x14\x9a\x69\x03\x82\xba\xf7\x57\x9d\x4c\x3b\x36\x38\xbc\x18\x1a\x65\xba\xef\x0a\xeb\xba\x4a\x2a\x72\xa8\xf0\x36\xb8\xd1\x09\x8f\xd5\xfa\x46\xc0\x4f\x51\x45\x48\x2a\xd5\xc8\xd2\x84\xab\x31\x37\xcd\x5a\x5b\x17\x13\x75\xe8\x18\x64\x3c\x49\x7c\x2c\x12\x52\xca\xdc\xc8\xb1\xb2\x58\x66\xdc\x29\xb0\xf6\xfa\x1a\x01\xae\x83\xf0\x2e\xa9\xf7\x72\xc1\xf4\xa1\x7c\x4d\x34\x7a\x60\xce\x34\xd9\x59\xe7\x12\xae\x44\x5b\x64\x06\x3c\xb9\xf3\xbd\xbf\x60\x40\x30\xc8\xac\x03\x86\xa6\x94\xea\x66\x7c\xd0\xef\x73\x1b\xde\xb0\x0c\x64\xee\x04\xa7\x90\x6a\x89\xa0\x99\x5f\x6f\xad\xba\x6e\x5a\xcb\x8b\x3b\xd7\x17\x3c\x2e\xd4\xa1\xb4\x3d\xe8\xa1\x73\x5c\x55\xed\x02\x78\xdd\x24\x24\x3d\x82\x48\xcb\x83\x94\xa0\x5c\x8a\xa0\x38\xa3\x44\xfb\xea\x95\x1b\xf6\x9c\x73\x95\x12\x03\x49\x7d\x4b\x66\x4e\x85\x38\x51\x1a\x2a\x82\x84\x73\xe0\x4c\x67\x21\xa5\x56\x9c\x02\x27\xce\x5c\xe3\xf5\x9b\x92\x7d\x4f\x18\xcf\x11\x12\x42\x47\x93\x82\xc5\x91\x49\xc1\x8c\x74\x82\x57\xd8\x90\x19\x79\x4e\x9a\x61\x4b\x12\x4f\xd4\x96\x4c\x12\x53\x77\xa9\xb5\x2e\xfc\x22\xcf\x1c\xc5\x4e\x15\x17\x9b\x3d\x43\x6d\xaa\x9e\x58\xaa\xfa\x57\x1f\xd4\x5f\x46\xf7\x19\x42\xb7\xa6\x3b\x5e\x57\x55\x25\xf3\x1a\x86\x09\x77\xb8\xb4\x1f\x23\xde\xd9\x8c\x38\xb0\x18\x82\x2e\x00\xb5\x3d\x39\xf0\xf2\x2f\x6a\x85\x0a\x92\x24\x67\x55\x21\xb4\x84\x29\xa8\x14\xd5\x3c\x42\xbc\xf4\xc6\xb0\x28\x7c\xb4\x68\xe3\x32\x65\xbc\x08\x52\x32\x3c\x31\x91\xca\xa7\xf9\xe8\xbb\x80\xb5\x15\x27\x14\x2c\xc4\xbe\xd5\xd0\xda\x20\x61\xc2\xcc\x3e\x51\xb3\xcd\xa2\x10\xf6\x80\x20\x86\x11\x11\x4d\x77\x36\xd1\x78\x77\xe3\xd3\xcd\xaf\x61\x4d\xa1\x55\x51\xe2\xbf\xc1\xc6\xe6\xad\x8b\x7f\x43\x8d\xd8\x86\xbb\x27\xbb\xb7\x74\xde\xea\x70\x2c\xa3\x53\x95\x7b\x4f\xe7\x32\xc8\xe4\xf4\x4d\x94\x1b\x2e\x83\xfb\x54\x6c\xc8\x16\xa8\x5e\x82\x8e\x73\x6b\xaa\x44\xaa\xe5\xf7\x93\xfc\x47\xb6\x5b\xff\x6e\x06\x53\x24\x5b\x0a\x43\x82\x0f\xb8\x63\x67\xf9\x14\xbd\x03\x74\xc8\x77\x22\xec\xea\xe6\x3b\x43\x87\xfe\xe5\x91\xf2\x6e\xca\xc8\xaa\x3e\xb4\x9d\xd8\xba\xb5\xd5\x36\x78\x89\x47\x2f\x86\x2c\x37\xff\xb2\x29\xb4\x37\x81\x5d\xdd\x23\x31\x86\xd0\x63\x50\xa3\x39\xb3\xde\xbf\x01\x87\x06\xdb\x21\x4e\x18\xaa\xa9\x16\x40\xa1\x90\x9b\x3a\xff\x1b\x48\xf5\xab\xfb\xf5\xcf\xf3\xc1\xfa\x9b\x15\xef\x77\x11\x25\xd5\xd5\xb9\x3e\xc4\xf3\x02\x6e\xa7\xbe\x83\x75\x7d\xe3\xe5\x1a\x24\x43\xe7\x72\xd5\x54\xbf\x97\xeb\xad\x97\xcb\x3a\x5c\xec\x2c\xdb\x70\x57\x71\xca\x92\xc1\x37\xa0\x6a\x8e\x6d\x7f\x1a\x36\x99\xe3\x4b\xd1\x7e\x0d\x35\x75\xf5\xa0\x21\x19\xd9\xdb\xb6\x06\xad\x8d\x38\xad\xf9\x82\xf9\xe3\xee\xc3\x44\xa5\x38\x75\x53\xf1\x95\x4a\xac\x05\xae\x75\xb8\xd7\xd4\x6a\xc2\x1b\xeb\x0e\x3f\x74\x1b\xc7\x88\x86\x7f\xf0\xd9\x5b\xa1\xa7\x38\x0f\x76\xbd\x7f\xf4\x0f\xf2\xaa\x4f\xd6\xb6\x3d\xfb\x58\x24\xd5\xbd\xdf\x4e\xc2\xde\x76\xf7\x25\x46\x3f\x54\x70\x7d\x0c\x67\x1f\x23\x36\x1f\xa5\x8d\xdc\x6c\x58\x75\xff\x96\x1f\x19\xae\x5e\x56\xff\x0d\x00\x00\xff\xff\x19\x6c\xac\x27\xce\x3d\x00\x00") + +func dataConfig_schema_v35JsonBytes() ([]byte, error) { + return bindataRead( + _dataConfig_schema_v35Json, + "data/config_schema_v3.5.json", + ) +} + +func dataConfig_schema_v35Json() (*asset, error) { + bytes, err := dataConfig_schema_v35JsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "data/config_schema_v3.5.json", size: 15822, mode: os.FileMode(420), modTime: time.Unix(1510079013, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -349,4 +369,3 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } - diff --git a/cli/compose/schema/data/config_schema_v3.5.json b/cli/compose/schema/data/config_schema_v3.5.json index 1151bb0642..bcd3b11091 100644 --- a/cli/compose/schema/data/config_schema_v3.5.json +++ b/cli/compose/schema/data/config_schema_v3.5.json @@ -470,6 +470,7 @@ "id": "#/definitions/secret", "type": "object", "properties": { + "name": {"type": "string"}, "file": {"type": "string"}, "external": { "type": ["boolean", "object"], @@ -486,6 +487,7 @@ "id": "#/definitions/config", "type": "object", "properties": { + "name": {"type": "string"}, "file": {"type": "string"}, "external": { "type": ["boolean", "object"], diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index 296e259575..8b8ea2317e 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -348,6 +348,7 @@ type CredentialSpecConfig struct { // FileObjectConfig is a config type for a file used by a service type FileObjectConfig struct { + Name string File string External External Labels Labels