aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/heat/onap-rke/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'deployment/heat/onap-rke/scripts')
-rwxr-xr-xdeployment/heat/onap-rke/scripts/get-image-tags.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/deployment/heat/onap-rke/scripts/get-image-tags.sh b/deployment/heat/onap-rke/scripts/get-image-tags.sh
new file mode 100755
index 000000000..7c7508448
--- /dev/null
+++ b/deployment/heat/onap-rke/scripts/get-image-tags.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+CHECKSUMS=$(kubectl get pods -o jsonpath="{..imageID}" |tr -s '[[:space:]]' '\n' | grep '/onap' | sed 's|.*/onap|onap|' | sort -u)
+
+for checksum in $CHECKSUMS; do
+ sha256=$(echo $checksum | sed 's/.*@sha256://g')
+ tag=$(curl -s https://nexus3.onap.org/service/rest/v1/search?assets.attributes.checksum.sha256=$sha256 | jq -r '.items[] | (.name + ":" + .version + "_")' | grep -v latest | sort -V | tail -1 | sed 's/_$//')
+ echo ${tag:-${checksum}}
+done