1
+ #! /bin/bash
2
+
1
3
# Copyright 2025 The Kubernetes Authors.
2
4
#
3
5
# Licensed under the Apache License, Version 2.0 (the 'License');
@@ -34,10 +36,13 @@ function build_and_push() {
34
36
MAX_IMAGES=10000
35
37
IMAGE_COUNT=$( aws ecr list-images --repository-name " ${IMAGE##*/ } " --region " ${REGION} " --query ' length(imageIds[])' )
36
38
37
- if [ $IMAGE_COUNT -ge $MAX_IMAGES ]; then
38
- loudecho " Repository image limit reached. Unable to push new images."
39
- exit 1
40
- fi
39
+ loudecho " there are ${IMAGE_COUNT} images"
40
+
41
+
42
+ # if [ $IMAGE_COUNT -ge $MAX_IMAGES ]; then
43
+ # loudecho "Repository image limit reached. Unable to push new images."
44
+ # exit 1
45
+ # fi
41
46
42
47
loudecho " Building and pushing test driver images to ${IMAGE} :${IMAGE_TAG} "
43
48
aws ecr get-login-password --region " ${REGION} " | docker login --username AWS --password-stdin " ${AWS_ACCOUNT_ID} .dkr.ecr.${REGION} .amazonaws.com"
@@ -51,7 +56,7 @@ function build_and_push() {
51
56
52
57
loudecho " Images pushed to ${IMAGE_NAME} :${IMAGE_TAG} "
53
58
}
54
-
59
+ aws ecr delete-repository --repository-name aws-ebs-csi-driver --force
55
60
REPO_CHECK=$( aws ecr describe-repositories --region " ${AWS_REGION} " )
56
61
if [ $( jq " .repositories | map(.repositoryName) | index(\" ${IMAGE_NAME##*/ } \" )" <<< " ${REPO_CHECK}" ) == " null" ]; then
57
62
aws ecr create-repository --region " ${AWS_REGION} " --repository-name aws-ebs-csi-driver > /dev/null
@@ -68,18 +73,18 @@ imageSuffixes=("a1compat fips-windows-amd64-ltsc2022 fips-windows-amd64-ltsc2019
68
73
loudecho " Ensuring all images are present"
69
74
70
75
for suffix in ${imageSuffixes[@]} ; do
71
- if [ ! " $( crane digest " ${IMAGE} " :" ${TAG} " -" ${suffix} " ) " ]; then
76
+ if [ ! " $( docker manifest inspect " ${IMAGE} " :" ${TAG} " -" ${suffix} " ) " ]; then
72
77
loudecho " $suffix image not found"
73
78
exit 1
74
79
fi
75
80
done
76
81
77
82
loudecho " Ensuring image indexes have all images"
78
- if [ ! " $( crane manifest ${IMAGE} :${TAG} | jq " .manifests.[3].platform" ) " ]; then
83
+ if [ ! " $( docker manifest inspect ${IMAGE} :${TAG} | jq " .manifests.[3].platform" ) " ]; then
79
84
loudecho " Error index image is missing images"
80
85
exit 1
81
86
fi
82
- if [ ! " $( crane manifest ${IMAGE} :${TAG} -fips | jq " .manifests.[3].platform" ) " ]; then
87
+ if [ ! " $( docker manifest inspect ${IMAGE} :${TAG} -fips | jq " .manifests.[3].platform" ) " ]; then
83
88
loudecho " Error fips index image is missing images"
84
89
exit 1
85
90
fi
0 commit comments