Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: adjust AWS logic to force delete ECR registry that contains images #211

Merged
merged 2 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions extras/jenkins/AWS/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \\;
'''
Expand Down
2 changes: 1 addition & 1 deletion pulumi/python/infrastructure/aws/ecr/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down