diff --git a/cli/compose/convert/service.go b/cli/compose/convert/service.go index f6808a2d5c..ad3b203d95 100644 --- a/cli/compose/convert/service.go +++ b/cli/compose/convert/service.go @@ -98,6 +98,12 @@ func convertService( return swarm.ServiceSpec{}, err } + var privileges swarm.Privileges + privileges.CredentialSpec, err = convertCredentialSpec(service.CredentialSpec) + if err != nil { + return swarm.ServiceSpec{}, err + } + var logDriver *swarm.Driver if service.Logging != nil { logDriver = &swarm.Driver{ @@ -130,6 +136,7 @@ func convertService( OpenStdin: service.StdinOpen, Secrets: secrets, ReadOnly: service.ReadOnly, + Privileges: &privileges, }, LogDriver: logDriver, Resources: resources, @@ -477,3 +484,17 @@ func convertDNSConfig(DNS []string, DNSSearch []string) (*swarm.DNSConfig, error } return nil, nil } + +func convertCredentialSpec(spec composetypes.CredentialSpecConfig) (*swarm.CredentialSpec, error) { + if spec.File == "" && spec.Registry == "" { + return nil, nil + } + if spec.File != "" && spec.Registry != "" { + return nil, errors.New("Invalid credential spec - must provide one of `File` or `Registry`") + } + + return &swarm.CredentialSpec{ + File: spec.File, + Registry: spec.Registry, + }, nil +} diff --git a/cli/compose/convert/service_test.go b/cli/compose/convert/service_test.go index 23e423d8f4..dd7f6ba253 100644 --- a/cli/compose/convert/service_test.go +++ b/cli/compose/convert/service_test.go @@ -316,3 +316,30 @@ func TestConvertDNSConfigSearch(t *testing.T) { Search: search, }, dnsConfig) } + +func TestConvertCredentialSpec(t *testing.T) { + swarmSpec, err := convertCredentialSpec(composetypes.CredentialSpecConfig{}) + assert.NoError(t, err) + assert.Nil(t, swarmSpec) + + swarmSpec, err = convertCredentialSpec(composetypes.CredentialSpecConfig{ + File: "/foo", + }) + assert.NoError(t, err) + assert.Equal(t, swarmSpec.File, "/foo") + assert.Equal(t, swarmSpec.Registry, "") + + swarmSpec, err = convertCredentialSpec(composetypes.CredentialSpecConfig{ + Registry: "foo", + }) + assert.NoError(t, err) + assert.Equal(t, swarmSpec.File, "") + assert.Equal(t, swarmSpec.Registry, "foo") + + swarmSpec, err = convertCredentialSpec(composetypes.CredentialSpecConfig{ + File: "/asdf", + Registry: "foo", + }) + assert.Error(t, err) + assert.Nil(t, swarmSpec) +} diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index 12e00e1de2..530e348423 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -198,6 +198,22 @@ secrets: assert.Equal(t, len(actual.Secrets), 1) } +func TestLoadV33(t *testing.T) { + actual, err := loadYAML(` +version: "3.3" +services: + foo: + image: busybox + credential_spec: + File: "/foo" +`) + if !assert.NoError(t, err) { + return + } + assert.Equal(t, len(actual.Services), 1) + assert.Equal(t, actual.Services[0].CredentialSpec.File, "/foo") +} + func TestParseAndLoad(t *testing.T) { actual, err := loadYAML(sampleYAML) if !assert.NoError(t, err) { diff --git a/cli/compose/schema/bindata.go b/cli/compose/schema/bindata.go index 8120866cf2..dba99812e6 100644 --- a/cli/compose/schema/bindata.go +++ b/cli/compose/schema/bindata.go @@ -131,7 +131,7 @@ func dataConfig_schema_v32Json() (*asset, error) { return a, nil } -var _dataConfig_schema_v33Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x4b\x6f\xdb\xb8\x13\xbf\xfb\x53\x08\x6a\x6f\xcd\xa3\x40\x8b\x3f\xf0\xef\x6d\x8f\x7b\xda\x3d\x6f\xe0\x0a\x34\x35\x96\xd9\x48\x24\x4b\x52\x4e\xdc\x22\xdf\x7d\xa1\xa7\x49\x8a\x14\xa9\x58\x69\xb2\x8b\x3d\xb5\x91\x66\x86\x9c\x27\x7f\xc3\x91\x7f\x6e\x92\x24\x7d\x2f\xf1\x01\x2a\x94\x7e\x49\xd2\x83\x52\xfc\xcb\xed\xed\x37\xc9\xe8\x75\xf7\xf4\x86\x89\xe2\x36\x17\x68\xaf\xae\x3f\x7e\xbe\xed\x9e\xbd\x4b\xaf\x1a\x3e\x92\x37\x2c\x98\xd1\x3d\x29\xb2\xee\x4d\x76\xfc\x74\xf3\xe9\xa6\x61\xef\x48\xd4\x89\x43\x43\xc4\x76\xdf\x00\xab\xee\x99\x80\xef\x35\x11\xd0\x30\xdf\xa5\x47\x10\x92\x30\x9a\x6e\xaf\x36\xcd\x3b\x2e\x18\x07\xa1\x08\xc8\xf4\x4b\xd2\x6c\x2e\x49\x46\x92\xe1\x81\x26\x56\x2a\x41\x68\x91\xb6\x8f\x9f\x5a\x09\x49\x92\x4a\x10\x47\x82\x35\x09\xe3\x56\xdf\xdd\x9e\xe5\xdf\x8e\x64\x57\xb6\x54\x6d\xb3\xed\x73\x8e\x94\x02\x41\xff\x9c\xee\xad\x7d\xfd\xf5\x0e\x5d\xff\xf8\xed\xfa\xaf\x8f\xd7\xff\xbf\xc9\xae\xb7\x1f\xde\x1b\xaf\x1b\xfb\x0a\xd8\x77\xcb\xe7\xb0\x27\x94\x28\xc2\xe8\xb8\x7e\x3a\x52\x3e\xf5\xff\x7b\x1a\x17\x46\x79\xde\x12\xa3\xd2\x58\x7b\x8f\x4a\x09\xa6\xce\x14\xd4\x03\x13\xf7\x21\x9d\x47\xb2\x57\xd2\xb9\x5f\xdf\xa1\xb3\xa9\xce\x91\x95\x75\x15\xf4\xe0\x40\xf5\x4a\xca\x74\xcb\xaf\xe3\x3f\x09\x58\x80\x0a\x87\x6c\x47\xf5\x6a\x11\xdb\x2c\x7f\x99\xc2\x9b\x41\xe9\x59\xda\x8e\x42\x5b\xbb\xdd\xa0\x91\xde\x2e\x53\xb9\xd2\xcb\x6f\xab\xd1\x58\x1e\x2b\xe5\xc0\x4b\x76\x6a\x9e\x79\xec\xd1\x11\x54\x40\x55\x3a\x9a\x20\x49\xd2\x5d\x4d\xca\xdc\xb6\x28\xa3\xf0\x47\x23\xe2\x4e\x7b\x98\x24\x3f\xed\x4a\xa6\xc9\x69\xdf\x1b\x7f\xf9\x1d\x3e\xbe\xf7\xe8\x32\xbe\xc7\x8c\x2a\x78\x54\xad\x52\xf3\x4b\x77\x26\x60\xf8\x1e\xc4\x9e\x94\x10\xcb\x81\x44\x21\x67\x4c\x56\x12\xa9\x32\x26\xb2\x9c\x60\xe5\xe4\x2f\xd1\x0e\xca\x8b\x24\x60\x84\x0f\x90\xed\x05\xab\x82\x52\xf6\x59\xa7\x89\x4c\x9f\x2c\x39\x13\xc1\xe1\xd0\x1e\x59\xb5\xbf\xb6\x1b\x87\xc0\x14\x23\x9e\xa1\x3c\x37\x4c\x8a\x84\x40\xa7\xf4\x2a\x49\x89\x82\x4a\xba\xad\x9d\xa4\x35\x25\xdf\x6b\xf8\xbd\x27\x51\xa2\x06\x5b\x6e\x2e\x18\x5f\x5f\x70\x21\x58\xcd\x33\x8e\x44\x13\xeb\xf3\x91\x90\x62\x56\x55\x88\xae\x95\x00\x4b\xf4\x88\xb0\x3c\xa3\x0a\x11\x0a\x22\xa3\xa8\x0a\xc5\x74\x53\x00\x80\xe6\x32\xeb\xb0\x47\x6c\x24\x19\x02\x46\x20\xb2\xaa\x3f\x72\x3a\x97\x21\x9d\x98\x26\x47\x9a\xbd\xa5\x16\x63\x26\x01\x09\x7c\x78\x26\x3f\xab\x10\xa1\x31\xb6\x03\xaa\xc4\x89\x33\xd2\xc5\xcb\x9b\x0b\x04\xa0\xc7\x6c\x2c\x6b\x8b\xcd\x00\xf4\x48\x04\xa3\xd5\x90\x0d\x71\x95\x4a\xe3\x7f\xe4\x4c\x82\x6d\x18\x4b\x41\xfd\xd5\xa8\xaa\x61\x93\x81\xe3\x6e\x50\xfc\x2a\x49\x69\x5d\xed\x40\x34\x70\xda\xa0\xdc\x33\x51\xa1\x66\xb3\xc3\xda\xda\x6b\xc3\xd2\x8e\xc8\xd3\x0d\xa8\xeb\xd0\x20\x0c\x54\x66\x25\xa1\xf7\xeb\x87\x38\x3c\x2a\x81\xb2\x03\x93\xea\x39\x87\x41\x7a\x00\x54\xaa\x03\x3e\x00\xbe\x9f\x61\xd7\xa9\x0c\x6e\x26\x55\x4c\x90\x93\x0a\x15\x61\x22\x8e\x43\x24\xcf\x3e\xf4\xd2\x55\x8d\xaf\x89\x65\x45\xd1\x90\xfa\x22\x6e\x02\xa2\xfa\xd7\x21\xf8\x91\x0b\x72\x04\x11\x8b\x25\x18\x3f\x63\x3f\xfb\x65\x18\x0b\x25\x61\x20\x6c\x90\x7e\xbd\xe9\x70\xf0\x4c\x56\xb5\xff\x2b\xcb\x74\x6b\xc3\x85\xc4\x3a\xf7\x5d\x4f\x2c\x0d\xe3\x00\x85\xe1\x95\x0a\xe1\x06\x37\x08\x90\x1e\xbf\x9e\x49\xfb\x46\x2b\xab\x58\xee\x0b\xd0\x09\xb1\x6d\x1b\x6f\xa5\x5e\x7c\x10\x26\xcf\x82\xb2\x51\xae\x0b\xf6\x32\x01\x6d\x7c\xdb\x8b\xdd\xe6\x79\xbb\xe1\x10\x6b\xe9\x50\x49\x90\x84\x70\xb2\x7b\x0d\x69\x48\x23\xfc\xf8\x39\x32\x26\x5c\xbc\xff\x9b\xe5\xf5\xb0\x7a\x65\xc6\x63\xe4\x80\xa8\xf3\x56\xda\x74\x73\x6d\x64\x1b\xc8\xb6\x17\x86\xf0\x9c\xe4\xfe\x5a\xd1\x56\x08\x3d\xc1\x38\x13\x6a\x92\x5d\xcb\x8f\x7b\x5f\x04\xeb\xe6\x1a\xea\xd4\xf9\xc0\xef\x16\x9f\x58\x63\xe2\xee\x28\xa6\x69\xfe\x05\xf3\x23\x9c\x19\xe9\x4c\x95\x72\x50\x2b\x24\x0a\x30\xdb\x10\x42\x15\x14\x20\x3c\x0c\xbc\xde\x95\x44\x1e\x20\x5f\xc2\x23\x98\x62\x98\x95\x71\x89\xe1\xec\x84\xe3\x93\xc1\x14\xb8\xbd\x18\x9b\x71\x41\x8e\xa4\x84\xc2\xd2\x78\xc7\x58\x09\x88\x1a\x07\x85\x00\x94\x67\x8c\x96\xa7\x08\x4a\xa9\x90\x08\xb6\x7f\x12\x70\x2d\x88\x3a\x65\x8c\xab\xd5\x51\xa1\x3c\x54\x99\x24\x3f\xc0\xcc\xbd\x73\xd4\xf7\x82\xb6\xd6\x86\xac\xab\xb5\xe4\xa5\xd2\xcf\x17\xb6\x2f\x94\x36\x92\xd5\x02\x5f\x96\x38\xb3\xf4\xb5\x59\xe4\xe6\x89\x8b\x25\xc4\x93\x84\xef\x5d\x18\xc2\x50\xb3\xa9\xe2\x2c\xd4\xf2\x24\xb1\x7a\x1e\xb6\x96\x2a\x27\x34\x63\x1c\x68\x30\x37\xa4\x62\x3c\x2b\x04\xc2\x90\x71\x10\x84\x39\x4d\x61\x14\xd8\xbc\x16\xa8\x59\x7f\x2a\x46\x92\x82\x22\x77\xdd\xd1\x48\x55\xc5\xf7\xcf\xbc\x04\x50\x2a\x9c\xec\x75\x49\x2a\xe2\x4f\x1a\x47\xd4\x46\xe0\xb5\x0e\xab\xb9\x21\xda\x0c\x3c\x8b\x2a\xd9\x33\x1d\xc2\x7c\x83\x10\xd1\x19\x1c\x90\x58\x70\x74\xb4\x89\xb9\xf7\x9c\x4f\xae\xbe\xc1\xb9\x2f\x63\x48\xd6\xca\xbb\xea\x37\xb2\x75\xd2\x2f\x82\x5e\xf6\x36\xb6\x5e\xf4\xe3\x4e\xaa\x5a\x06\x9b\xb8\x96\x86\xca\xb9\x06\x64\x24\x9d\x4e\x7b\x92\x7f\x44\x85\x36\x7c\xd4\x92\x3b\x7c\x13\x51\xc7\xfb\x95\x22\x6b\xe7\x4b\x57\xfd\x68\x44\xa0\xf1\x60\x46\x25\x91\x0a\x28\x3e\xc5\x2f\xb4\x23\x93\x5b\xe2\xa9\x51\xe6\xfb\xae\xb8\xae\xab\xa5\x42\x45\x57\x6f\xa3\x1b\x9d\xf8\x5c\xed\x07\x81\xbf\x44\x15\xca\x30\xe3\x1e\xd7\xc4\xab\xb1\xf4\x98\xb5\xae\x2e\x66\x70\xa8\xaf\x64\x3c\x30\x71\xdf\x1c\x48\x39\x71\x57\x8e\x8d\xc5\xb2\x60\x76\x6a\xdd\xf5\x0d\x02\x5c\x43\x41\x9d\x34\x38\x44\x9d\x1f\x50\xf6\x44\xde\xe1\x21\x91\x68\x67\x8d\xcd\x5c\x07\x6d\x73\x32\x88\x63\xf8\xbc\x17\xa0\x04\xb1\x46\x09\x03\x68\xd2\xcf\x76\x90\x6f\xf3\xc2\x5d\x91\x0a\x58\xed\x2e\x43\x1b\x3d\x70\x7a\xa6\x54\x1b\xae\x06\x9c\xaa\x51\xda\x3e\xbd\x1b\x9d\x3a\xf4\xe5\x41\xc7\xc5\x1c\x58\x40\xf3\x76\xb4\x11\x75\xba\x09\xe0\x25\xc1\x48\x86\x10\xc4\x05\xb7\xc0\x35\xcf\x91\x82\xac\xfb\x12\x67\x11\x66\x9b\x01\x6b\x1c\x09\x54\x96\x50\x12\x59\xc5\x80\x9f\x34\x87\x12\x39\xab\x7f\x10\xf7\xb6\xec\x7b\x44\xca\x5a\x40\x86\xb0\xb7\x4c\x5b\x1c\x15\xa3\x44\x31\x67\x39\x89\x5b\xb2\x42\x8f\xd9\xb0\x6c\x4b\x12\x6a\x49\xcc\x6e\x3c\xf6\x02\x57\x8b\x84\xee\xec\x5e\x06\xab\x67\x5c\x74\x06\xe9\x9e\x88\x19\x56\x9c\xa8\x2e\x40\x36\x65\x67\xbc\x5f\x0f\xf2\x07\x0b\x7c\x7f\x3d\x90\x71\x56\x92\x0e\x05\xac\xa1\x21\x66\xb4\x33\x72\x4c\x40\x5c\x18\x81\x4d\x38\x34\x3d\x4c\xc5\x55\x30\x59\x5b\x86\x07\x42\x73\xf6\xb0\x60\xc1\xf5\x42\x89\x97\x08\x83\x55\x1c\x2f\x35\xb4\x54\x02\x11\xaa\x16\x8f\x93\x6c\xb3\x70\x01\x7b\x10\x40\xa7\x81\x9e\xcc\xc3\xfa\xc4\x0f\xed\x43\xba\x85\x35\xec\x29\x24\x6f\xf0\xed\x2b\xdc\xea\x5d\xea\xfc\x0b\x00\xd2\x98\xc5\x81\x83\x74\xa4\x0b\x42\x23\xdf\xe1\x89\x79\x1d\x1c\x4d\x55\x50\x31\xe1\x6e\x13\x2e\xd0\x71\xf8\xb2\x30\xa0\xe2\x40\xb6\x02\x50\x88\x9a\x65\xf6\x54\x19\xe3\xeb\x5f\xa6\x84\xe7\x95\xdb\x70\xd9\x26\x1c\x55\x6b\xd5\x90\xe8\xe9\x6e\xea\x44\x2a\xc9\x1b\xa8\x0e\xf5\x8e\x7a\x7a\xe5\xb7\x5d\x1d\xcc\x2f\x27\xda\x0f\x33\x3c\x5e\xbd\x1b\xdb\x90\xab\xd1\x56\xdb\x68\x17\x7b\xbf\x8a\x58\x6f\xff\x6d\x47\x64\xdf\x80\xba\x5a\x27\xa4\x14\xc2\x87\xa8\x2e\x6b\x21\xb4\xbe\xa0\x0e\x4d\xee\x02\x9c\x65\xa8\xa7\xfa\xaf\x0a\xfd\x4b\x62\xf6\xd7\xc5\x57\xff\x0d\x76\xf0\xe3\xe7\x96\xea\xd9\xe7\x78\xc4\x17\xbf\x6f\xc0\x67\xaf\xed\x0a\x73\xc4\xa2\xb9\x64\x7a\xe3\x32\x67\xc9\xa5\xdf\x28\x6f\xcd\x6d\xd8\x64\x8e\x9f\xc9\x98\x87\xe9\xdc\x00\x76\x20\xf1\xdc\xf0\x59\x8b\xf6\x46\x9c\xd7\x7c\xc5\x62\x73\xf3\x61\x06\x32\xcc\x7d\xaf\xf5\x42\x67\xed\x0a\xc3\x6d\xb7\x4f\xad\x6e\x6c\xb0\xee\xf4\xa7\x0f\x9e\xfc\xd7\xf8\x27\x3f\x84\x68\xf4\xa4\xa7\xc9\x8d\xe0\x4f\x73\x9c\xd1\xfd\x88\x61\x6b\xd8\xc7\x22\xe9\xbe\x7e\xd4\xaa\xfb\x56\x6f\x50\x7d\x6e\x74\xfe\x3c\xc2\x1e\xa6\x0c\x3f\x53\xf0\xcc\x77\x37\xfa\xbf\xed\x4f\x4a\x36\x4f\x9b\xbf\x03\x00\x00\xff\xff\xca\x6f\x19\x50\xcb\x36\x00\x00") +var _dataConfig_schema_v33Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x4d\x73\xdc\x28\x13\xbe\xcf\xaf\x50\x29\xb9\xc5\x1f\xa9\x4a\xea\xad\x7a\x73\xdb\xe3\x9e\x76\xcf\xeb\x9a\xa8\x18\xd4\xa3\x21\x96\x80\x00\x1a\x7b\x92\xf2\x7f\xdf\xd2\xe7\x00\x02\x81\x3c\x72\xec\xdd\xda\x93\x3d\xd2\xd3\x0d\xdd\x74\x37\xdd\x34\xfa\xb9\x49\x92\xf4\xbd\xc4\x07\xa8\x50\xfa\x25\x49\x0f\x4a\xf1\x2f\xb7\xb7\xdf\x24\xa3\xd7\xdd\xd3\x1b\x26\x8a\xdb\x5c\xa0\xbd\xba\xfe\xf8\xf9\xb6\x7b\xf6\x2e\xbd\x6a\xe8\x48\xde\x90\x60\x46\xf7\xa4\xc8\xba\x37\xd9\xf1\xd3\xcd\xa7\x9b\x86\xbc\x83\xa8\x13\x87\x06\xc4\x76\xdf\x00\xab\xee\x99\x80\xef\x35\x11\xd0\x10\xdf\xa5\x47\x10\x92\x30\x9a\x6e\xaf\x36\xcd\x3b\x2e\x18\x07\xa1\x08\xc8\xf4\x4b\xd2\x4c\x2e\x49\x46\xc8\xf0\x40\x63\x2b\x95\x20\xb4\x48\xdb\xc7\x4f\x2d\x87\x24\x49\x25\x88\x23\xc1\x1a\x87\x71\xaa\xef\x6e\xcf\xfc\x6f\x47\xd8\x95\xcd\x55\x9b\x6c\xfb\x9c\x23\xa5\x40\xd0\x3f\xa7\x73\x6b\x5f\x7f\xbd\x43\xd7\x3f\x7e\xbb\xfe\xeb\xe3\xf5\xff\x6f\xb2\xeb\xed\x87\xf7\xc6\xeb\x46\xbf\x02\xf6\xdd\xf0\x39\xec\x09\x25\x8a\x30\x3a\x8e\x9f\x8e\xc8\xa7\xfe\xbf\xa7\x71\x60\x94\xe7\x2d\x18\x95\xc6\xd8\x7b\x54\x4a\x30\x65\xa6\xa0\x1e\x98\xb8\x0f\xc9\x3c\xc2\x5e\x49\xe6\x7e\x7c\x87\xcc\xa6\x38\x47\x56\xd6\x55\x70\x05\x07\xd4\x2b\x09\xd3\x0d\xbf\xce\xfa\x49\xc0\x02\x54\xd8\x64\x3b\xd4\xab\x59\x6c\x33\xfc\x65\x02\x6f\x06\xa1\x67\xb1\x1d\x42\x1b\xbb\x9d\xa0\xe1\xde\x2e\x55\xb9\xdc\xcb\xaf\xab\x51\x59\x1e\x2d\xe5\xc0\x4b\x76\x6a\x9e\x79\xf4\xd1\x01\x2a\xa0\x2a\x1d\x55\x90\x24\xe9\xae\x26\x65\x6e\x6b\x94\x51\xf8\xa3\x61\x71\xa7\x3d\x4c\x92\x9f\x76\x24\xd3\xf8\xb4\xef\x8d\x5f\xfe\x05\x1f\xdf\x7b\x64\x19\xdf\x63\x46\x15\x3c\xaa\x56\xa8\xf9\xa1\x3b\x15\x30\x7c\x0f\x62\x4f\x4a\x88\xa5\x40\xa2\x90\x33\x2a\x2b\x89\x54\x19\x13\x59\x4e\xb0\x72\xd2\x97\x68\x07\xe5\x45\x1c\x30\xc2\x07\xc8\xf6\x82\x55\x41\x2e\xfb\xac\x93\x44\xa6\x4f\x16\x9f\x09\xe3\xb0\x69\x8f\xa4\xda\xaf\xed\xc6\xc1\x30\xc5\x88\x67\x28\xcf\x0d\x95\x22\x21\xd0\x29\xbd\x4a\x52\xa2\xa0\x92\x6e\x6d\x27\x69\x4d\xc9\xf7\x1a\x7e\xef\x21\x4a\xd4\x60\xf3\xcd\x05\xe3\xeb\x33\x2e\x04\xab\x79\xc6\x91\x68\x6c\x7d\xde\x12\x52\xcc\xaa\x0a\xd1\xb5\x1c\x60\x89\x1c\x11\x9a\x67\x54\x21\x42\x41\x64\x14\x55\x21\x9b\x4e\xb1\x80\x1c\xa8\x22\xa8\xcc\x24\x07\x6c\xc0\x07\x07\x9c\x71\xb9\x34\xca\x6f\x52\x01\x05\x91\x4a\x9c\x9c\xc8\xb3\x14\xfa\xc4\x72\xe0\x40\x73\x99\x75\x49\x51\xac\x89\x1b\x0c\xc6\x0c\x69\x55\x43\xc9\xe9\x9c\xeb\x76\x6c\x1a\xe7\x6d\xe6\x96\x5a\x84\x99\x04\x24\xf0\xe1\x99\xf4\xac\x42\x84\xc6\x2c\x2a\x50\x25\x4e\x9c\x91\xce\x90\xdf\x9c\x85\x02\x3d\x66\xa3\xdd\x2c\x56\x03\xd0\x23\x11\x8c\x56\x83\x9b\xc6\x85\x50\x8d\xfe\x91\x33\x09\xb6\x62\x2c\x01\xf5\x57\xa3\xa8\x86\x4e\x06\x8a\xbb\x41\xf0\xab\x24\xa5\x75\xb5\x03\xd1\xe4\xf9\x06\x72\xcf\x44\x85\x9a\xc9\x0e\x63\x6b\xaf\x4d\x3f\x99\x5a\x9e\xae\x40\x5d\x86\x26\xf5\x41\x65\x56\x12\x7a\xbf\xbe\x89\xc3\xa3\x12\x28\x3b\x30\xa9\x9e\xb3\x4b\xa5\x07\x40\xa5\x3a\xe0\x03\xe0\xfb\x19\x72\x1d\x65\x50\x33\xa9\x62\x8c\x9c\x54\xa8\x08\x83\x38\x0e\x41\x9e\xbd\x1b\xa7\xab\x2a\x5f\x63\xcb\x8a\xa2\x81\xfa\x2c\x6e\x92\xdd\xf5\xaf\x43\x79\x51\x2e\xc8\x11\x44\x6c\x92\xc3\xf8\x39\x29\xb5\x5f\x86\x93\xb4\x24\x9c\xa1\x1b\xd0\xaf\x37\x5d\x82\x3e\xe3\x55\xed\x7f\x65\x99\x6e\xed\x3c\x26\xb1\x12\x12\xd7\x13\x4b\xc2\xb8\x4c\xc7\x58\x95\x0a\xe1\x26\xa1\x11\x20\x3d\xeb\x7a\x86\xf6\x15\x60\x56\xb1\xdc\x67\xa0\x13\xf0\x64\x63\xf5\x45\xea\xc5\x1b\x61\xf2\xac\x1c\x3b\x6a\xe9\x82\x45\x56\x40\x1a\xdf\xf4\x62\xa7\x79\x9e\x6e\xd8\xc4\x5a\x1c\x2a\x09\x92\x10\x76\x76\xaf\x22\x0d\x6e\x84\x1f\x3f\x47\xda\x84\x8b\xf6\x7f\xb3\xb4\x1e\x52\x2f\xcf\xf8\xe4\x3d\xc0\xea\x3c\x95\xd6\xdd\x5c\x13\xd9\x06\xbc\xed\x85\x6b\x0b\x4e\x72\x7f\xac\x68\x23\x84\xee\x60\x9c\x09\x35\xf1\xae\xe5\xdb\xbd\xcf\x82\x75\x75\x0d\x71\xea\xbc\xe1\x77\x83\x4f\xb4\x31\x59\xee\x28\xa2\xa9\xff\x05\xfd\x23\xec\x19\xe9\x4c\x94\x72\xa0\x15\x12\x05\x98\xf5\x11\xa1\x0a\x0a\x10\x1e\x02\x5e\xef\x4a\x22\x0f\x90\x2f\xa1\x11\x4c\x31\xcc\xca\x38\xc7\x70\x96\xe8\xf1\xce\x60\x32\xdc\x5e\x9c\x9b\x71\x41\x8e\xa4\x84\xc2\x92\x78\xc7\x58\x09\x88\x1a\x1b\x85\x00\x94\x67\x8c\x96\xa7\x08\xa4\x54\x48\x04\xeb\x52\x09\xb8\x16\x44\x9d\x32\xc6\xd5\xea\x59\xa1\x3c\x54\x99\x24\x3f\xc0\xf4\xbd\xb3\xd5\xf7\x8c\xb6\xd6\x84\xac\x33\xbf\xe4\xa5\xdc\xcf\x67\xb6\x2f\xe4\x36\x92\xd5\x02\x5f\xe6\x38\xb3\xf8\xda\x0c\x72\xf3\xe0\x62\x09\x78\xe2\xf0\xfd\x12\x86\x72\xa8\x59\x57\x71\x06\x6a\x79\x92\x58\x3d\x2f\xb7\x96\x2a\x27\x34\x63\x1c\x68\xd0\x37\xa4\x62\x3c\x2b\x04\xc2\x90\x71\x10\x84\x39\x55\x61\x04\xd8\xbc\x16\xa8\x19\x7f\xca\x46\x92\x82\x22\x77\xdc\xd1\xa0\xaa\xe2\xfb\x67\x1e\x02\x28\x15\x76\xf6\xba\x24\x15\xf1\x3b\x8d\xc3\x6a\x23\xf2\xb5\x2e\x57\x73\xa7\x68\x33\xe9\x59\x54\xc8\x9e\xa9\x10\xe6\x0b\x84\x88\xca\xe0\x80\xc4\x82\xad\xa3\x75\xcc\xbd\x67\x7f\x72\xd5\x0d\xce\x79\x19\xdd\xbb\x96\xdf\x55\x3f\x91\xad\x13\xbf\x28\xf5\xb2\xa7\xb1\xf5\x66\x3f\x6e\xa7\xaa\x65\xb0\x88\x6b\x31\x54\xce\x15\x20\x23\x74\xda\x86\x4a\xfe\x11\x11\xda\x58\xa3\x16\xee\x58\x9b\x88\x38\xde\x8f\x14\x19\x3b\x5f\x3a\xea\x47\x67\x04\x1a\x0d\x66\x54\x12\xa9\x80\x62\xf7\xf9\xaa\x93\x68\x47\x26\xc7\xd7\x53\xa5\xcc\xd7\x5d\x71\x55\x57\x8b\x42\x45\x17\x6f\xa3\x0b\x9d\x78\x5f\xed\x3b\x94\xbf\x44\x14\xca\x30\xe3\x9e\xa5\x89\x17\x63\xe9\x36\x6b\x1d\x5d\xcc\xe4\xa1\xbe\x90\xf1\xc0\xc4\x7d\xb3\x21\xe5\xc4\x1d\x39\x36\x16\xc9\x82\xa6\xae\x75\xd6\x37\x30\x70\x75\x2b\x75\x68\xb0\xbb\x3b\xdf\x39\xed\x41\xde\xae\x26\x91\x68\x67\xf5\x25\x5c\x1b\x6d\xb3\x33\x88\x63\x78\xbf\x17\xa0\x04\xb1\x5a\x09\x43\xd2\xa4\xef\xed\x20\xdf\xe6\x81\xbb\x22\x15\xb0\xda\x1d\x86\x36\xba\xe1\xf4\x44\xa9\xd6\xf5\x0d\x2c\xaa\x86\xb4\xd7\xf4\x4e\x6b\x20\x75\x75\x79\x70\xe1\x62\x36\x2c\xa0\x79\xdb\xda\x88\xda\xdd\x04\xf0\x92\x60\x24\x43\x19\xc4\x05\xa7\xc0\x35\xcf\x91\x82\xac\xbb\x22\xb4\x28\x67\x9b\x49\xd6\x38\x12\xa8\x2c\xa1\x24\xb2\x8a\x49\x7e\xd2\x1c\x4a\xe4\x8c\xfe\xc1\xbc\xb7\x25\xdf\x23\x52\xd6\x02\x32\x84\xbd\x61\xda\xa2\xa8\x18\x25\x8a\x39\xc3\x49\xdc\x90\x15\x7a\xcc\x86\x61\x5b\x48\xa8\x24\x31\xab\xf1\xd8\x03\x5c\xcd\x12\xba\xbd\x7b\x59\x5a\x3d\xb3\x44\xe7\x24\xdd\x63\x31\xc3\x88\x13\xd1\x05\xc8\x26\xec\x8c\xe7\xeb\x41\xfa\x60\x80\xef\x8f\x07\x32\xce\x4a\xd2\x65\x01\x6b\x48\x88\x19\xed\x94\x1c\x63\x10\x17\x5a\x60\x63\x0e\x4d\x0d\x53\x71\x15\x74\xd6\x96\xe0\x81\xd0\x9c\x3d\x2c\x18\x70\x3d\x53\xe2\x25\xc2\x60\x05\xc7\x4b\x15\x2d\x95\x40\x84\xaa\xc5\xed\x24\x5b\x2d\x5c\xc0\x1e\x04\xd0\xa9\xa1\x27\xf3\x69\x7d\xe2\x4f\xed\x43\xb2\x85\x25\xec\x11\x92\x37\xf9\xed\x2b\x9c\xea\x5d\xba\xf8\x17\x24\x48\xa3\x17\x07\x36\xd2\x11\x17\x4c\x8d\x7c\x9b\x27\xe6\x75\xb0\x35\x55\x41\xc5\xe6\xaf\x61\x5c\x70\x33\x33\x24\xe2\x00\x5b\x21\x51\x88\xea\x65\xf6\xa8\x8c\xf1\xf5\x0f\x53\xc2\xfd\xca\x6d\x38\x6c\x13\x8e\xaa\xb5\x62\x48\x74\x77\x37\x75\x66\x2a\xc9\x1b\x88\x0e\xf5\x8e\x7a\x6a\xe5\xb7\x1d\x1d\xcc\x9b\x13\xed\xc5\x0c\xcf\xaa\xde\x8d\x65\xc8\xd5\xa8\xab\x6d\xf4\x12\x7b\x6f\x45\xac\x37\xff\xb6\x22\xb2\x4f\x40\x5d\xa5\x13\x52\x0a\xe1\x43\x54\x95\xb5\x30\xb5\xbe\x20\x0e\x4d\xce\x02\x9c\x61\xa8\x47\xfd\x17\x85\xfe\x25\x36\xfb\xeb\xec\xab\xbf\x1c\x1e\xbc\x95\xdd\xa2\x9e\xbd\x8f\x47\x5c\xa9\x7c\x03\x6b\xf6\xda\x4b\x61\xb6\x58\xb4\x25\x99\x9e\xb8\xcc\x69\x72\xe9\xe5\xe9\xad\x39\x0d\x1b\xe6\xf8\x7e\xc7\xdc\x4c\xe7\x1a\xb0\x03\xc4\x73\xc2\x67\x0d\xda\x2b\x71\x5e\xf2\x15\x83\xcd\xcd\x87\x99\x94\x61\xee\xbe\xd6\x0b\xed\xb5\x2b\x34\xb7\xdd\x6b\x6a\x55\x63\x83\x76\xa7\xdf\x64\x78\xfc\x5f\xa3\x9f\x7c\xa1\xd1\xc8\x49\x4f\x93\x13\xc1\x9f\x66\x3b\xa3\xfb\xba\x62\x6b\xe8\xc7\x82\x74\xb7\x1f\xb5\xe8\xbe\xd5\x0b\x54\xef\x75\x6d\xd7\x77\x1b\x76\x33\x65\xf8\x7e\xc2\xd3\xdf\xdd\xe8\x7f\xdb\x6f\x5d\x36\x4f\x9b\xbf\x03\x00\x00\xff\xff\x39\x5d\x41\x2a\x64\x37\x00\x00") func dataConfig_schema_v33JsonBytes() ([]byte, error) { return bindataRead( diff --git a/cli/compose/schema/data/config_schema_v3.3.json b/cli/compose/schema/data/config_schema_v3.3.json index efdd41625f..66efb14bb0 100644 --- a/cli/compose/schema/data/config_schema_v3.3.json +++ b/cli/compose/schema/data/config_schema_v3.3.json @@ -89,6 +89,10 @@ ] }, "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"}, diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index 88ee84d463..225dd00ec8 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -76,8 +76,9 @@ type ServiceConfig struct { CapDrop []string `mapstructure:"cap_drop"` CgroupParent string `mapstructure:"cgroup_parent"` Command ShellCommand - ContainerName string `mapstructure:"container_name"` - DependsOn []string `mapstructure:"depends_on"` + ContainerName string `mapstructure:"container_name"` + CredentialSpec CredentialSpecConfig `mapstructure:"credential_spec"` + DependsOn []string `mapstructure:"depends_on"` Deploy DeployConfig Devices []string DNS StringList @@ -310,3 +311,9 @@ type SecretConfig struct { External External Labels Labels } + +// CredentialSpecConfig for credential spec on Windows +type CredentialSpecConfig struct { + File string + Registry string +}