Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: Tag cached image with the ECR URI for the given target region #1442

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion scripts/install-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ if [[ "$CACHE_CONTAINER_IMAGES" == "true" ]] && ! [[ ${ISOLATED_REGIONS} =~ $BIN
#### Tag the pulled down image for all other regions in the partition
for region in $(aws ec2 describe-regions --all-regions | jq -r '.Regions[] .RegionName'); do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you cache this at e.g. line 444 while you're at it? 😄

REGIONS=$(aws ec2 describe-regions --all-regions --output text --query 'Regions[].[RegionName]')
...
for REGION in ${REGIONS[@]}; do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in f58d748

for img in "${PULLED_IMGS[@]}"; do
regional_img="${img/$BINARY_BUCKET_REGION/$region}"
region_uri=$(/etc/eks/get-ecr-uri.sh "${region}" "${AWS_DOMAIN}")
regional_img="${img/$ECR_URI/$region_uri}"
sudo ctr -n k8s.io image tag "${img}" "${regional_img}" || :
## Tag ECR fips endpoint for supported regions
if [[ "${region}" =~ (us-east-1|us-east-2|us-west-1|us-west-2|us-gov-east-1|us-gov-east-2) ]]; then
Expand Down