Skip to content

Commit ecb9611

Browse files
author
Jason Schmidt
authored
fix: adjust AWS logic to force delete ECR registry that contains images (#211)
* fix: adjusted ECR to force delete unused registry * fix: remove unneeded registry delete
1 parent 4cef006 commit ecb9611

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

extras/jenkins/AWS/Jenkinsfile

-4
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,11 @@ pipeline {
188188
* Clean up the environment; this includes running the destroy script to remove our pulumi resources and
189189
* destroy the deployed infrastructure in AWS
190190
*
191-
* AWS will not remove a registry that contains images, so we do a force removal here; this should ultimately
192-
* be fixed in the code.
193-
*
194191
* After that completes, we remove the pulumi stack from the project with the find command; this is because
195192
* we need to delete the stack in each project it's been instantiated in.
196193
*/
197194

198195
sh '''
199-
$WORKSPACE/pulumi/python/venv/bin/aws ecr delete-repository --repository-name ingress-controller-marajenkaws${BUILD_NUMBER} --force
200196
$WORKSPACE/pulumi/python/runner -p aws -s marajenkaws${BUILD_NUMBER} destroy
201197
find . -mindepth 2 -maxdepth 6 -type f -name Pulumi.yaml -execdir $WORKSPACE/pulumi/python/venv/bin/pulumi stack rm marajenkaws${BUILD_NUMBER} --force --yes \\;
202198
'''

pulumi/python/infrastructure/aws/ecr/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
ecr_repo = ecr.Repository(name=f'ingress-controller-{stack_name}',
99
resource_name=f'nginx-ingress-repository-{stack_name}',
1010
image_tag_mutability="MUTABLE",
11-
force_delete=False,
11+
force_delete=True,
1212
tags={"Project": project_name, "Stack": stack_name})
1313

1414
pulumi.export('repository_url', ecr_repo.repository_url)

0 commit comments

Comments
 (0)