From 55a21122d01cb74ecfabb7486474bbb2ffb80b40 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 18 Aug 2020 11:38:23 +0200 Subject: [PATCH] Copytight header Signed-off-by: Nicolas De Loof --- compose/api.go | 7 +++---- compose/tags.go | 16 +++++++++++++++ ecs/backend.go | 2 ++ ecs/cloudformation.go | 26 +++++++++++++++++++++---- ecs/cloudformation_test.go | 21 ++++++++++++++++++-- ecs/colors.go | 16 +++++++++++++++ ecs/compatibility.go | 16 +++++++++++++++ ecs/convert.go | 40 ++++++++++++++++++-------------------- ecs/down.go | 16 +++++++++++++++ ecs/iam.go | 16 +++++++++++++++ ecs/list.go | 19 +++++++++++++++++- ecs/logs.go | 18 ++++++++++++++++- ecs/marshall.go | 16 +++++++++++++++ ecs/sdk.go | 25 ++++++++++++++++++++---- ecs/secrets.go | 18 ++++++++++++++++- ecs/secrets/Dockerfile | 14 +++++++++++++ ecs/secrets/init.go | 16 +++++++++++++++ ecs/secrets/init_test.go | 37 ++++++++++++++++++++++++++--------- ecs/secrets/main/main.go | 19 +++++++++++++++++- ecs/up.go | 18 ++++++++++++++++- ecs/wait.go | 19 +++++++++++++++++- ecs/x.go | 16 +++++++++++++++ go.sum | 5 ----- secrets/api.go | 16 +++++++++++++++ 24 files changed, 377 insertions(+), 55 deletions(-) diff --git a/compose/api.go b/compose/api.go index ec055e7e6..2cd4c3a10 100644 --- a/compose/api.go +++ b/compose/api.go @@ -37,8 +37,7 @@ type Service interface { Convert(ctx context.Context, opts *cli.ProjectOptions) ([]byte, error) } - -type LoadBalancer struct { +type PortPublisher struct { URL string TargetPort int PublishedPort int @@ -51,5 +50,5 @@ type ServiceStatus struct { Replicas int Desired int Ports []string - LoadBalancers []LoadBalancer -} \ No newline at end of file + LoadBalancers []PortPublisher +} diff --git a/compose/tags.go b/compose/tags.go index 43236d45f..cd9ecbe34 100644 --- a/compose/tags.go +++ b/compose/tags.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package compose const ( diff --git a/ecs/backend.go b/ecs/backend.go index 156289e79..be9c68f9a 100644 --- a/ecs/backend.go +++ b/ecs/backend.go @@ -18,8 +18,10 @@ package ecs import ( "context" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" + "github.com/docker/api/secrets" "github.com/docker/api/backend" diff --git a/ecs/cloudformation.go b/ecs/cloudformation.go index 85f40a6a3..0e9685d33 100644 --- a/ecs/cloudformation.go +++ b/ecs/cloudformation.go @@ -1,14 +1,32 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( "context" "fmt" - "github.com/compose-spec/compose-go/cli" - "github.com/docker/api/compose" "io/ioutil" "regexp" "strings" + "github.com/compose-spec/compose-go/cli" + + "github.com/docker/api/compose" + ecsapi "github.com/aws/aws-sdk-go/service/ecs" "github.com/aws/aws-sdk-go/service/elbv2" cloudmapapi "github.com/aws/aws-sdk-go/service/servicediscovery" @@ -329,13 +347,13 @@ func createLoadBalancer(project *types.Project, template *cloudformation.Templat } if ports == 0 { // Project do not expose any port (batch jobs?) - // So no need to create a LoadBalancer + // So no need to create a PortPublisher return "" } // load balancer names are limited to 32 characters total loadBalancerName := fmt.Sprintf("%.32s", fmt.Sprintf("%sLoadBalancer", strings.Title(project.Name))) - // Create LoadBalancer if `ParameterLoadBalancerName` is not set + // Create PortPublisher if `ParameterLoadBalancerName` is not set template.Conditions["CreateLoadBalancer"] = cloudformation.Equals("", cloudformation.Ref(ParameterLoadBalancerARN)) loadBalancerType := getLoadBalancerType(project) diff --git a/ecs/cloudformation_test.go b/ecs/cloudformation_test.go index 3943ee1f4..5f1d6ba41 100644 --- a/ecs/cloudformation_test.go +++ b/ecs/cloudformation_test.go @@ -1,11 +1,28 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( "fmt" - "github.com/docker/api/compose" "reflect" "testing" + "github.com/docker/api/compose" + "github.com/aws/aws-sdk-go/service/elbv2" "github.com/awslabs/goformation/v4/cloudformation" "github.com/awslabs/goformation/v4/cloudformation/ec2" @@ -187,7 +204,7 @@ services: for _, r := range template.Resources { assert.Check(t, r.AWSCloudFormationType() != "AWS::ElasticLoadBalancingV2::TargetGroup") assert.Check(t, r.AWSCloudFormationType() != "AWS::ElasticLoadBalancingV2::Listener") - assert.Check(t, r.AWSCloudFormationType() != "AWS::ElasticLoadBalancingV2::LoadBalancer") + assert.Check(t, r.AWSCloudFormationType() != "AWS::ElasticLoadBalancingV2::PortPublisher") } } diff --git a/ecs/colors.go b/ecs/colors.go index 3af58af59..22d609c81 100644 --- a/ecs/colors.go +++ b/ecs/colors.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( diff --git a/ecs/compatibility.go b/ecs/compatibility.go index 2fdd527a5..316c6b889 100644 --- a/ecs/compatibility.go +++ b/ecs/compatibility.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( diff --git a/ecs/convert.go b/ecs/convert.go index 17db60648..477989cdb 100644 --- a/ecs/convert.go +++ b/ecs/convert.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( @@ -14,11 +30,11 @@ import ( ecsapi "github.com/aws/aws-sdk-go/service/ecs" "github.com/awslabs/goformation/v4/cloudformation" "github.com/awslabs/goformation/v4/cloudformation/ecs" - "github.com/awslabs/goformation/v4/cloudformation/tags" "github.com/compose-spec/compose-go/types" - "github.com/docker/api/ecs/secrets" "github.com/docker/cli/opts" "github.com/joho/godotenv" + + "github.com/docker/api/ecs/secrets" ) const secretsInitContainerImage = "docker/ecs-secrets-sidecar" @@ -185,7 +201,7 @@ func createEnvironment(project *types.Project, service types.ServiceConfig) ([]e if err != nil { return nil, err } - defer file.Close() + defer file.Close() // nolint:errcheck env, err := godotenv.Parse(file) if err != nil { @@ -234,17 +250,6 @@ func getLogConfiguration(service types.ServiceConfig, project *types.Project) *e return logConfiguration } -func toTags(labels types.Labels) []tags.Tag { - t := []tags.Tag{} - for n, v := range labels { - t = append(t, tags.Tag{ - Key: n, - Value: v, - }) - } - return t -} - func toSystemControls(sysctls types.Mapping) []ecs.TaskDefinition_SystemControl { sys := []ecs.TaskDefinition_SystemControl{} for k, v := range sysctls { @@ -324,13 +329,6 @@ func toContainerReservation(service types.ServiceConfig) (string, int, error) { return reservations.NanoCPUs, int(reservations.MemoryBytes / MiB), nil } -func toRequiresCompatibilities(isolation string) []*string { - if isolation == "" { - return nil - } - return []*string{&isolation} -} - func toPlacementConstraints(deploy *types.DeployConfig) []ecs.TaskDefinition_TaskDefinitionPlacementConstraint { if deploy == nil || deploy.Placement.Constraints == nil || len(deploy.Placement.Constraints) == 0 { return nil diff --git a/ecs/down.go b/ecs/down.go index 849b1c675..55e0dec96 100644 --- a/ecs/down.go +++ b/ecs/down.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( diff --git a/ecs/iam.go b/ecs/iam.go index 3dca431bd..30670b0f5 100644 --- a/ecs/iam.go +++ b/ecs/iam.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs const ( diff --git a/ecs/list.go b/ecs/list.go index 7642471b9..02be946e5 100644 --- a/ecs/list.go +++ b/ecs/list.go @@ -1,11 +1,28 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( "context" "fmt" - "github.com/docker/api/compose" "strings" + "github.com/docker/api/compose" + "github.com/compose-spec/compose-go/cli" ) diff --git a/ecs/logs.go b/ecs/logs.go index 8594e2dc0..58010fc13 100644 --- a/ecs/logs.go +++ b/ecs/logs.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( @@ -50,7 +66,7 @@ func (l *logConsumer) Log(service, container, message string) { for _, line := range strings.Split(message, "\n") { buf := bytes.NewBufferString(fmt.Sprintf("%s %s\n", cf(prefix), line)) - l.writer.Write(buf.Bytes()) + l.writer.Write(buf.Bytes()) // nolint:errcheck } } diff --git a/ecs/marshall.go b/ecs/marshall.go index 414563622..8ef38a9df 100644 --- a/ecs/marshall.go +++ b/ecs/marshall.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( diff --git a/ecs/sdk.go b/ecs/sdk.go index 5fa88937e..3d499b1b1 100644 --- a/ecs/sdk.go +++ b/ecs/sdk.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( @@ -312,6 +328,7 @@ type StackResource struct { ARN string Status string } + func (s sdk) ListStackResources(ctx context.Context, name string) ([]StackResource, error) { // FIXME handle pagination res, err := s.CF.ListStackResourcesWithContext(ctx, &cloudformation.ListStackResourcesInput{ @@ -488,7 +505,7 @@ func (s sdk) DescribeServices(ctx context.Context, cluster string, arns []string return status, nil } -func (s sdk) getURLWithPortMapping(ctx context.Context, targetGroupArns []string) ([]compose.LoadBalancer, error) { +func (s sdk) getURLWithPortMapping(ctx context.Context, targetGroupArns []string) ([]compose.PortPublisher, error) { if len(targetGroupArns) == 0 { return nil, nil } @@ -522,14 +539,14 @@ func (s sdk) getURLWithPortMapping(ctx context.Context, targetGroupArns []string } return nil } - loadBalancers := []compose.LoadBalancer{} + loadBalancers := []compose.PortPublisher{} for _, tg := range groups.TargetGroups { for _, lbarn := range tg.LoadBalancerArns { lb := filterLB(lbarn, lbs.LoadBalancers) if lb == nil { continue } - loadBalancers = append(loadBalancers, compose.LoadBalancer{ + loadBalancers = append(loadBalancers, compose.PortPublisher{ URL: aws.StringValue(lb.DNSName), TargetPort: int(aws.Int64Value(tg.Port)), PublishedPort: int(aws.Int64Value(tg.Port)), @@ -573,7 +590,7 @@ func (s sdk) GetPublicIPs(ctx context.Context, interfaces ...string) (map[string } func (s sdk) LoadBalancerExists(ctx context.Context, arn string) (bool, error) { - logrus.Debug("CheckRequirements if LoadBalancer exists: ", arn) + logrus.Debug("CheckRequirements if PortPublisher exists: ", arn) lbs, err := s.ELB.DescribeLoadBalancersWithContext(ctx, &elbv2.DescribeLoadBalancersInput{ LoadBalancerArns: []*string{aws.String(arn)}, }) diff --git a/ecs/secrets.go b/ecs/secrets.go index 80291815d..60c8964f1 100644 --- a/ecs/secrets.go +++ b/ecs/secrets.go @@ -1,11 +1,27 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( "context" + "github.com/docker/api/secrets" ) - func (b *ecsAPIService) CreateSecret(ctx context.Context, secret secrets.Secret) (string, error) { return b.SDK.CreateSecret(ctx, secret) } diff --git a/ecs/secrets/Dockerfile b/ecs/secrets/Dockerfile index 238f43ddc..5490ffc41 100644 --- a/ecs/secrets/Dockerfile +++ b/ecs/secrets/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2020 Docker, Inc. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM golang:1.14.4-alpine AS builder WORKDIR $GOPATH/src/github.com/docker/api/ecs/secrets COPY . . diff --git a/ecs/secrets/init.go b/ecs/secrets/init.go index 1903d3cc9..8ee28f295 100644 --- a/ecs/secrets/init.go +++ b/ecs/secrets/init.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package secrets import ( diff --git a/ecs/secrets/init_test.go b/ecs/secrets/init_test.go index dd068f5af..5389a5c5c 100644 --- a/ecs/secrets/init_test.go +++ b/ecs/secrets/init_test.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package secrets import ( @@ -12,10 +28,11 @@ import ( func TestRawSecret(t *testing.T) { dir := fs.NewDir(t, "secrets").Path() - os.Setenv("raw", "something_secret") - defer os.Unsetenv("raw") + err := os.Setenv("raw", "something_secret") + assert.NilError(t, err) + defer os.Unsetenv("raw") // nolint:errcheck - err := CreateSecretFiles(Secret{ + err = CreateSecretFiles(Secret{ Name: "raw", Keys: nil, }, dir) @@ -28,14 +45,15 @@ func TestRawSecret(t *testing.T) { func TestSelectedKeysSecret(t *testing.T) { dir := fs.NewDir(t, "secrets").Path() - os.Setenv("json", ` + err := os.Setenv("json", ` { "foo": "bar", "zot": "qix" }`) - defer os.Unsetenv("json") + assert.NilError(t, err) + defer os.Unsetenv("json") // nolint:errcheck - err := CreateSecretFiles(Secret{ + err = CreateSecretFiles(Secret{ Name: "json", Keys: []string{"foo"}, }, dir) @@ -51,14 +69,15 @@ func TestSelectedKeysSecret(t *testing.T) { func TestAllKeysSecret(t *testing.T) { dir := fs.NewDir(t, "secrets").Path() - os.Setenv("json", ` + err := os.Setenv("json", ` { "foo": "bar", "zot": "qix" }`) - defer os.Unsetenv("json") + assert.NilError(t, err) + defer os.Unsetenv("json") // nolint:errcheck - err := CreateSecretFiles(Secret{ + err = CreateSecretFiles(Secret{ Name: "json", Keys: []string{"*"}, }, dir) diff --git a/ecs/secrets/main/main.go b/ecs/secrets/main/main.go index c66c6de3a..b70baf0d6 100644 --- a/ecs/secrets/main/main.go +++ b/ecs/secrets/main/main.go @@ -1,10 +1,27 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package main import ( "encoding/json" "fmt" - "github.com/docker/api/ecs/secrets" "os" + + "github.com/docker/api/ecs/secrets" ) const secretsFolder = "/run/secrets" diff --git a/ecs/up.go b/ecs/up.go index 44d16227b..a3e0b4dc1 100644 --- a/ecs/up.go +++ b/ecs/up.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( @@ -85,7 +101,7 @@ func (b *ecsAPIService) Up(ctx context.Context, options *cli.ProjectOptions) err go func() { <-signalChan fmt.Println("user interrupted deployment. Deleting stack...") - b.Down(ctx, options) + b.Down(ctx, options) // nolint:errcheck }() err = b.WaitStackCompletion(ctx, project.Name, operation) diff --git a/ecs/wait.go b/ecs/wait.go index 4ca41d85d..04632ee6b 100644 --- a/ecs/wait.go +++ b/ecs/wait.go @@ -1,13 +1,30 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs import ( "context" "fmt" - "github.com/docker/api/progress" "sort" "strings" "time" + "github.com/docker/api/progress" + "github.com/aws/aws-sdk-go/aws" ) diff --git a/ecs/x.go b/ecs/x.go index 9dee6a36a..1f2ba5ce6 100644 --- a/ecs/x.go +++ b/ecs/x.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package ecs const ( diff --git a/go.sum b/go.sum index 2afc5e41f..9312e8a04 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,6 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.34.2 h1:9vCknCdTAmmV4ht7lPuda7aJXzllXwEQyCMZKJHjBrM= -github.com/aws/aws-sdk-go v1.34.2/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.6 h1:2aPXQGkR6xeheN5dns13mSoDWeUlj4wDmfZ+8ZDHauw= github.com/aws/aws-sdk-go v1.34.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/awslabs/goformation/v4 v4.14.0 h1:E2Pet9eIqA4qzt3dzzzE4YN83V4Kyfbcio0VokBC9TA= @@ -132,7 +130,6 @@ github.com/docker/cli v0.0.0-20200528204125-dd360c7c0de8 h1:JRquW4uqIU+eSilDhuo9 github.com/docker/cli v0.0.0-20200528204125-dd360c7c0de8/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20200708230824-53e18a9d9bfe h1:pni13lAFm1g4cjHU6c3n4qGvvJGZQK4VvKRKMseQ42E= github.com/docker/distribution v0.0.0-20200708230824-53e18a9d9bfe/go.mod h1:Oqz4IonmMNc2N7GqfTL2xkhCQx0yS6nR+HrOZJnmKIk= -github.com/docker/docker v1.13.1 h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo= github.com/docker/docker v17.12.0-ce-rc1.0.20200309214505-aa6a9891b09c+incompatible h1:G2hY8RD7jB9QaSmcb8mYEIg8QbEvVAB7se8+lXHZHfg= github.com/docker/docker v17.12.0-ce-rc1.0.20200309214505-aa6a9891b09c+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= @@ -534,8 +531,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.58.0 h1:VdDvTzv/005R8vEFyQ56bpEnOKTNPbpJhL0VCohxlQw= -gopkg.in/ini.v1 v1.58.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.60.0 h1:P5ZzC7RJO04094NJYlEnBdFK2wwmnCAy/+7sAzvWs60= gopkg.in/ini.v1 v1.60.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= diff --git a/secrets/api.go b/secrets/api.go index cb52b1a0d..f1231b7da 100644 --- a/secrets/api.go +++ b/secrets/api.go @@ -1,3 +1,19 @@ +/* + Copyright 2020 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package secrets import (