Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: torredil <[email protected]>
  • Loading branch information
torredil committed Apr 10, 2024
1 parent b83f0af commit e76b692
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hack/e2e/ecr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit e76b692

Please sign in to comment.