aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/heat/onap-rke/scripts/get-image-tags.sh
blob: 7c7508448c7d233c6f6d0a155b1379b01d053913 (plain)
1
2
3
4
5
6
7
8
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