From 0ea2b7fb48ac85cc68321b8fd47a512a80251cb5 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 30 Aug 2022 14:11:30 -0400 Subject: [PATCH] Fix matching for image propagation --- sync/propagate-image.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sync/propagate-image.sh b/sync/propagate-image.sh index 9df548b..c9a65c6 100644 --- a/sync/propagate-image.sh +++ b/sync/propagate-image.sh @@ -21,7 +21,8 @@ SOURCE_AMI_NAME=$(aws --profile resf-ami ec2 describe-images \ # Enforce a name structure # Rocky-8-ec2-8.6-20220515.0.x86_64 -if [[ ! "${SOURCE_AMI_NAME}" =~ Rocky-[89]-ec2-[89]\.[0-9]-[0-9]+\.[0-9]+\.((aarch|x86_)64|ppc64le|s390x) ]]; then +pat="Rocky-[89]-EC2-[89]\.[0-9]-[0-9]+\.[0-9]+\.((aarch|x86_)64|ppc64le|s390x)" +if [[ ! "${SOURCE_AMI_NAME}" =~ $pat ]]; then echo "Bad source ami (${SOURCE_AMI_NAME}). Exiting." exit 1 fi