From 2758612dec06319adf38978de0bdd1e6d0f4b48d Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Tue, 22 Nov 2022 08:54:23 -0700 Subject: [PATCH 1/2] fix: adjusted ECR to force delete unused registry --- pulumi/python/infrastructure/aws/ecr/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulumi/python/infrastructure/aws/ecr/__main__.py b/pulumi/python/infrastructure/aws/ecr/__main__.py index 1c29377..aa0a038 100644 --- a/pulumi/python/infrastructure/aws/ecr/__main__.py +++ b/pulumi/python/infrastructure/aws/ecr/__main__.py @@ -8,7 +8,7 @@ ecr_repo = ecr.Repository(name=f'ingress-controller-{stack_name}', resource_name=f'nginx-ingress-repository-{stack_name}', image_tag_mutability="MUTABLE", - force_delete=False, + force_delete=True, tags={"Project": project_name, "Stack": stack_name}) pulumi.export('repository_url', ecr_repo.repository_url) From 92d4c9808c5b45a879fe79609203459fd34b671c Mon Sep 17 00:00:00 2001 From: Jason Schmidt Date: Tue, 22 Nov 2022 09:31:07 -0700 Subject: [PATCH 2/2] fix: remove unneeded registry delete --- extras/jenkins/AWS/Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/extras/jenkins/AWS/Jenkinsfile b/extras/jenkins/AWS/Jenkinsfile index 9759b28..90e9f08 100644 --- a/extras/jenkins/AWS/Jenkinsfile +++ b/extras/jenkins/AWS/Jenkinsfile @@ -188,15 +188,11 @@ pipeline { * Clean up the environment; this includes running the destroy script to remove our pulumi resources and * destroy the deployed infrastructure in AWS * - * AWS will not remove a registry that contains images, so we do a force removal here; this should ultimately - * be fixed in the code. - * * After that completes, we remove the pulumi stack from the project with the find command; this is because * we need to delete the stack in each project it's been instantiated in. */ sh ''' - $WORKSPACE/pulumi/python/venv/bin/aws ecr delete-repository --repository-name ingress-controller-marajenkaws${BUILD_NUMBER} --force $WORKSPACE/pulumi/python/runner -p aws -s marajenkaws${BUILD_NUMBER} destroy find . -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkaws${BUILD_NUMBER} --force --yes \\; '''