From d7e57975a9a9f12a0137cc67a5b8d035c1d24079 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Thu, 29 Aug 2024 16:01:22 +0300 Subject: [PATCH 1/2] Update tools/get-images.sh to handle both Go and Python version of yq --- tools/get-images.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/get-images.sh b/tools/get-images.sh index c3159c6e..dc4892ca 100755 --- a/tools/get-images.sh +++ b/tools/get-images.sh @@ -4,6 +4,6 @@ # # dynamic list IMAGE_LIST=() -IMAGE_LIST+=($(find -type f -name metadata.yaml -exec yq '.resources | to_entries | .[] | .value | ."upstream-source"' {} \;)) -IMAGE_LIST+=($(find -type f -name config.yaml -exec yq '.options.*-image | select(.) | .default' {} \;)) +IMAGE_LIST+=($(find -type f -name metadata.yaml -exec yq '.resources | to_entries | .[] | .value | ."upstream-source"' {} \; | tr -d '"')) +IMAGE_LIST+=($(find -type f -name config.yaml -exec yq '.options | with_entries(select(.key | test("-image$"))) | .[].default' {} \; | tr -d '"')) printf "%s\n" "${IMAGE_LIST[@]}" From 441a27a51d5abe36aab6b7b5752aa5ee599cd05d Mon Sep 17 00:00:00 2001 From: mvlassis Date: Thu, 29 Aug 2024 16:42:28 +0300 Subject: [PATCH 2/2] Add set -xe to get-images.sh --- tools/get-images.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/get-images.sh b/tools/get-images.sh index dc4892ca..e62f273a 100755 --- a/tools/get-images.sh +++ b/tools/get-images.sh @@ -3,6 +3,9 @@ # This script returns list of container images that are managed by this charm and/or its workload # # dynamic list + +set -xe + IMAGE_LIST=() IMAGE_LIST+=($(find -type f -name metadata.yaml -exec yq '.resources | to_entries | .[] | .value | ."upstream-source"' {} \; | tr -d '"')) IMAGE_LIST+=($(find -type f -name config.yaml -exec yq '.options | with_entries(select(.key | test("-image$"))) | .[].default' {} \; | tr -d '"'))