Skip to content

Commit

Permalink
Merge pull request #1998 from torredil/master
Browse files Browse the repository at this point in the history
Log number of images in ECR repository for CI
  • Loading branch information
k8s-ci-robot authored Apr 11, 2024
2 parents ced0892 + d73905e commit e92b955
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hack/e2e/ecr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ function ecr_build_and_push() {
IMAGE_TAG=${4}
IMAGE_ARCH=${5}

# https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html
MAX_IMAGES=10000
IMAGE_COUNT=$(aws ecr list-images --repository-name ${IMAGE_NAME} --region ${REGION} --query 'length(imageIds[])')

if [ $IMAGE_COUNT -ge $MAX_IMAGES ]; then
loudecho "Repository image limit reached. Unable to push new images."
fi

loudecho "Building and pushing test driver image to ${IMAGE_NAME}:${IMAGE_TAG}"
aws ecr get-login-password --region "${REGION}" | docker login --username AWS --password-stdin "${AWS_ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com"

Expand Down

0 comments on commit e92b955

Please sign in to comment.