Update old_image_reference regex

This commit updates the old_image_reference regex to correctly handle
images records using a hostname with hyphens and/or a port specified.

Closes-bug: 1860465
Change-Id: Ibf88d1c675277d4b133d0fd68029555ceea3e18d
Signed-off-by: Joseph Richard <joseph.richard@windriver.com>
This commit is contained in:
Joseph Richard 2020-01-21 12:08:40 -05:00
parent 31aea8e88b
commit 6cadc45748

View File

@ -138,7 +138,7 @@ function build_image_versions_to_manifest {
image_record=${IMAGE_RECORD_PATH}/$(basename ${image_record})
for image_reference in $(cat ${image_record}); do
image_name=$(echo ${image_reference} | sed -n 's/.*\/\(.*\):.*$/\1/p')
old_image_reference="\([a-zA-Z0-9.]*\|[0-9.:]*\)\/.*${image_name}:.*"
old_image_reference="\([a-zA-Z0-9.:-]*\|[0-9.:]*\)\/.*${image_name}:.*"
sed -i "s#${old_image_reference}#${image_reference}#" ${manifest_file}
if [ $? -ne 0 ]; then