From e76b6920f21e05f215f99ee7934fde037e21b8c2 Mon Sep 17 00:00:00 2001 From: torredil Date: Wed, 10 Apr 2024 19:19:15 +0000 Subject: [PATCH] test Signed-off-by: torredil --- hack/e2e/ecr.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hack/e2e/ecr.sh b/hack/e2e/ecr.sh index 2ac925e72f..85694bb65f 100644 --- a/hack/e2e/ecr.sh +++ b/hack/e2e/ecr.sh @@ -23,15 +23,16 @@ function ecr_build_and_push() { IMAGE_TAG=${4} IMAGE_ARCH=${5} - loudecho "Checking number of images in the repository" - IMAGE_COUNT=$(aws ecr list-images --repository-name aws-ebs-csi-driver --region ${REGION} --query 'length(imageIds[])') - echo $IMAGE_COUNT - # https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html MAX_IMAGES=10000 + IMAGE_COUNT=$(aws ecr list-images --repository-name aws-ebs-csi-driver --region ${REGION} --query 'length(imageIds[])') + if [ $IMAGE_COUNT -ge $MAX_IMAGES ]; then loudecho "Repository image limit reached. Unable to push new images." + + echo "Deleting ECR repository" + aws ecr delete-repository --repository-name aws-ebs-csi-driver --region us-west-2 --force fi loudecho "Building and pushing test driver image to ${IMAGE_NAME}:${IMAGE_TAG}"