Skip to content

Commit

Permalink
ci: check image tag (#869) (#870)
Browse files Browse the repository at this point in the history
* ci: check image tag

* add script

Co-authored-by: Denis Mishin <dmishin@pomerium.com>
  • Loading branch information
backport-actions-token[bot] and wasaga authored Jan 10, 2024
1 parent 9177fab commit d059b2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ jobs:

- name: Check image reference
# check that docker image reference is the same as the release tag
run: |
set -e
img=$(yq eval '.spec.template.spec.containers[0].image' config/pomerium/deployment/image.yaml)
tag=${img#pomerium/ingress-controller:}
if [[ "${tag}" != ${{ github.event.release.tag_name }}" ]]; then
echo "Image tag mismatch: ${tag} != ${{ github.event.release.tag_name }}"
exit 1
fi
run: ./scripts/check-image-tag.sh ${{ github.event.release.tag_name }}

- name: Docker meta
id: meta
Expand Down
15 changes: 15 additions & 0 deletions scripts/check-image-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# checks that image tag matches the argument

set -e
want=$1
if [[ -z "${want}" ]]; then
echo "Usage: $0 <tag>"
exit 1
fi

img=$(yq eval '.spec.template.spec.containers[0].image' config/pomerium/deployment/image.yaml)
tag=${img#pomerium/ingress-controller:}
if [[ "${tag}" != "${want}" ]]; then
echo "Image tag mismatch: ${tag} != ${want}"
exit 1
fi

0 comments on commit d059b2c

Please sign in to comment.