From 849520e3af9dfc683273c269ad1f143bef969df6 Mon Sep 17 00:00:00 2001 From: Harry Pidcock Date: Mon, 28 Aug 2023 17:04:51 +1000 Subject: [PATCH] Add support for test_tags. --- images.yaml | 2 ++ make_functions.sh | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/images.yaml b/images.yaml index cae395b..bedabde 100644 --- a/images.yaml +++ b/images.yaml @@ -6,6 +6,7 @@ images: tags: - 4.4 - 4.4.18 + test_tag: 4.4 build_args: - BASE_IMAGE=public.ecr.aws/ubuntu/ubuntu:20.04 - SNAP_RISK=stable @@ -23,6 +24,7 @@ images: - public.ecr.aws/juju/juju-db tags: - 4.4.24 + test_tag: 4.4 build_args: - BASE_IMAGE=public.ecr.aws/ubuntu/ubuntu:20.04 - SNAP_RISK=candidate diff --git a/make_functions.sh b/make_functions.sh index 70cd76c..438dd96 100755 --- a/make_functions.sh +++ b/make_functions.sh @@ -68,9 +68,13 @@ microk8s_image_update() { fi reg_paths=$(yq -o=c ".images.[\"${image}\"].registry_paths" < images.yaml) tags=$(yq -o=c ".images.[\"${image}\"].tags" < images.yaml) + test_tag=$(yq ".images.[\"${image}\"].test_tag" < images.yaml) for reg_path in ${reg_paths//,/ }; do for tag in ${tags//,/ }; do + last_tag=${tag} docker save "${reg_path}:${tag}" | sudo microk8s.ctr --namespace k8s.io image import - done + docker tag "${reg_path}:${last_tag}" "${reg_path}:${test_tag}" + docker save "${reg_path}:${test_tag}" | sudo microk8s.ctr --namespace k8s.io image import - done }