claim support for deploy.replicas

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-07-10 09:35:32 +02:00
parent a0a785f19e
commit 1783716a6a
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
4 changed files with 19 additions and 1 deletions

View File

@ -14,7 +14,7 @@ require (
github.com/bugsnag/panicwrap v1.2.0 // indirect github.com/bugsnag/panicwrap v1.2.0 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cloudflare/cfssl v1.4.1 // indirect github.com/cloudflare/cfssl v1.4.1 // indirect
github.com/compose-spec/compose-go v0.0.0-20200709084333-492a50989a5a github.com/compose-spec/compose-go v0.0.0-20200710075715-6fcc35384ee1
github.com/containerd/containerd v1.3.2 // indirect github.com/containerd/containerd v1.3.2 // indirect
github.com/containerd/continuity v0.0.0-20200413184840-d3ef23f19fbb // indirect github.com/containerd/continuity v0.0.0-20200413184840-d3ef23f19fbb // indirect
github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492 github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492

View File

@ -60,6 +60,8 @@ github.com/compose-spec/compose-go v0.0.0-20200707124823-710ff8e60ad9 h1:WkFqc6U
github.com/compose-spec/compose-go v0.0.0-20200707124823-710ff8e60ad9/go.mod h1:ArodJ6gsEB7iWKrbV3fSHZ08LlBvSVB0Oqg04fX86t4= github.com/compose-spec/compose-go v0.0.0-20200707124823-710ff8e60ad9/go.mod h1:ArodJ6gsEB7iWKrbV3fSHZ08LlBvSVB0Oqg04fX86t4=
github.com/compose-spec/compose-go v0.0.0-20200709084333-492a50989a5a h1:pIiSz5jML7rQ1aupg/KHlTqCxhyXvIgeDMf4kDTzIg8= github.com/compose-spec/compose-go v0.0.0-20200709084333-492a50989a5a h1:pIiSz5jML7rQ1aupg/KHlTqCxhyXvIgeDMf4kDTzIg8=
github.com/compose-spec/compose-go v0.0.0-20200709084333-492a50989a5a/go.mod h1:ArodJ6gsEB7iWKrbV3fSHZ08LlBvSVB0Oqg04fX86t4= github.com/compose-spec/compose-go v0.0.0-20200709084333-492a50989a5a/go.mod h1:ArodJ6gsEB7iWKrbV3fSHZ08LlBvSVB0Oqg04fX86t4=
github.com/compose-spec/compose-go v0.0.0-20200710075715-6fcc35384ee1 h1:F+YIkKDMHdgZBacawhFY1P9RAIgO+6uv2te6hjsjzF0=
github.com/compose-spec/compose-go v0.0.0-20200710075715-6fcc35384ee1/go.mod h1:ArodJ6gsEB7iWKrbV3fSHZ08LlBvSVB0Oqg04fX86t4=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=

View File

@ -93,6 +93,20 @@ services:
assert.Check(t, len(lb.SecurityGroups) > 0) assert.Check(t, len(lb.SecurityGroups) > 0)
} }
func TestServiceReplicas(t *testing.T) {
template := convertYaml(t, `
version: "3"
services:
test:
image: nginx
deploy:
replicas: 10
`)
s := template.Resources["TestService"].(*ecs.Service)
assert.Check(t, s != nil)
assert.Check(t, s.DesiredCount == 10)
}
func TestLoadBalancerTypeNetwork(t *testing.T) { func TestLoadBalancerTypeNetwork(t *testing.T) {
template := convertYaml(t, ` template := convertYaml(t, `
version: "3" version: "3"

View File

@ -14,6 +14,8 @@ var compatibleComposeAttributes = []string{
"services.container_name", "services.container_name",
"services.cap_drop", "services.cap_drop",
"services.depends_on", "services.depends_on",
"services.deploy",
"services.deploy.replicas",
"services.entrypoint", "services.entrypoint",
"services.environment", "services.environment",
"service.image", "service.image",