Repository: docker/compose-cli
Pull request #860 (2020-11-02 08:43:48)

Nicer cleanup make target for ACI resources
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>

**What I did**
* Display resource groups that are going to be cleaned up
* grep ignore case, sometimes we have case difference in test resource group names

**Related issue**
<!-- If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" -->

<!-- optional tests
You can add a / mention to run tests executed by default only on main branch : 
* `test-aci` to run ACI E2E tests
* `test-ecs` to run ECS E2E tests
* `test-windows` to run tests & E2E tests on windows
-->

**(not mandatory) A picture of a cute animal, if possible in relation with what you did**
![](https://i.pinimg.com/originals/98/0f/45/980f451b0f2528f6867a8d422678714e.jpg)


Patch:
diff --git a/Makefile b/Makefile
index 7f6f5fa1..0ae7204c 100644
--- a/Makefile
+++ b/Makefile
@@ -104,14 +104,10 @@ build-aci-sidecar:  ## build aci sidecar image locally and tag it with make buil
 publish-aci-sidecar: build-aci-sidecar ## build & publish aci sidecar image with make publish-aci-sidecar tag=0.1
 	docker pull docker/aci-hostnames-sidecar:$(tag) && echo "Failure: Tag already exists" || docker push docker/aci-hostnames-sidecar:$(tag)
 
-build-ecs-search-sidecar:  ## build ecs search sidecar image locally and tag it with make build-ecs-search-sidecar tag=0.1
-	docker build -t docker/ecs-searchdomain-sidecar:$(tag) ecs/resolv
-
-publish-ecs-search-sidecar: build-ecs-search-sidecar ## build & publish ecs search sidecar image with make publish-ecs-search-sidecar tag=0.1
-	docker pull docker/ecs-searchdomain-sidecar:$(tag) && echo "Failure: Tag already exists" || docker push docker/ecs-searchdomain-sidecar:$(tag)
-
 clean-aci-e2e: ## Make sure no ACI tests are currently runnnig in the CI when invoking this. Delete ACI E2E tests resources that might have leaked when ctrl-C E2E tests.
-	 az group list | jq '.[].name' | grep E2E-Test | xargs -n1 az group delete -y --no-wait -g
+	@ echo "Will delete resource groups: "
+	@ az group list | jq '.[].name' | grep -i E2E-Test
+	az group list | jq '.[].name' | grep -i E2E-Test | xargs -n1 az group delete -y --no-wait -g
 
 help: ## Show help
 	@echo Please specify a build target. The choices are:
diff --git a/ecs/awsResources.go b/ecs/awsResources.go
index 012b3182..b336adad 100644
--- a/ecs/awsResources.go
+++ b/ecs/awsResources.go
@@ -167,8 +167,8 @@ func (b *ecsAPIService) parseClusterExtension(ctx context.Context, project *type
 func (b *ecsAPIService) parseVPCExtension(ctx context.Context, project *types.Project) (string, []awsResource, error) {
 	var vpc string
 	if x, ok := project.Extensions[extensionVPC]; ok {
-		vpc = x.(string)
-		err := b.aws.CheckVPC(ctx, vpc)
+		vpcID := x.(string)
+		err := b.aws.CheckVPC(ctx, vpcID)
 		if err != nil {
 			return "", nil, err
 		}
diff --git a/ecs/convert.go b/ecs/convert.go
index c20877fe..aef6007f 100644
--- a/ecs/convert.go
+++ b/ecs/convert.go
@@ -37,7 +37,7 @@ import (
 )
 
 const secretsInitContainerImage = "docker/ecs-secrets-sidecar"
-const searchDomainInitContainerImage = "docker/ecs-searchdomain-sidecar:1.0"
+const searchDomainInitContainerImage = "docker/ecs-searchdomain-sidecar"
 
 func (b *ecsAPIService) createTaskDefinition(project *types.Project, service types.ServiceConfig, resources awsResources) (*ecs.TaskDefinition, error) {
 	cpu, mem, err := toLimits(service)


Test patch:
diff --git a/ecs/testdata/simple/simple-cloudformation-conversion.golden b/ecs/testdata/simple/simple-cloudformation-conversion.golden
index d064cdd8..fa63524d 100644
--- a/ecs/testdata/simple/simple-cloudformation-conversion.golden
+++ b/ecs/testdata/simple/simple-cloudformation-conversion.golden
@@ -234,7 +234,7 @@
               "TestSimpleConvert.local"
             ],
             "Essential": "false",
-            "Image": "docker/ecs-searchdomain-sidecar:1.0",
+            "Image": "docker/ecs-searchdomain-sidecar",
             "LogConfiguration": {
               "LogDriver": "awslogs",
               "Options": {