Skip to content

Commit

Permalink
test: check existence of input KIC image and use it if exists in gke …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
randmonkey committed Nov 23, 2023
1 parent 63253d7 commit c656251
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/_e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ jobs:
with:
password: ${{ secrets.PULP_PASSWORD }}

- name: check availability of KIC image
id: check_kic_image
if: ${{ inputs.kic-image != '' }}
run: (docker manifest inspect ${{ inputs.kic-image }} && echo "kic_image=${{ inputs.kic-image }}" >> $GITHUB_OUTPUT) || true

- name: split image and tag
id: split
env:
Expand All @@ -233,6 +238,15 @@ jobs:
echo "kong-image=$kong_image" >> $GITHUB_OUTPUT
echo "kong-tag=$kong_tag" >> $GITHUB_OUTPUT
fi
if [ "${{ steps.check_kic_image.outputs.kic_image }}" != "" ]; then
export kic_image_repo=$(echo ${{ steps.check_kic_image.outputs.kic_image }} | awk '{split($0,a,":"); print a[1]}')
export kic_image_tag=$(echo ${{ steps.check_kic_image.outputs.kic_image }} | awk '{split($0,a,":"); print a[2]}')
echo "kic-image=$kic_image_repo" >> $GITHUB_OUTPUT
echo "kic-tag=$kic_image_tag" >> $GITHUB_OUTPUT
else
echo "kic-image=kong/nightly-ingress-controller" >> $GITHUB_OUTPUT
echo "kic-tag=nightly" >> $GITHUB_OUTPUT
fi
# see the https://github.com/Kong/kubernetes-testing-framework/issues/587 TODO below
# if we add local image GKE support, we probably need to split it into components here
Expand All @@ -243,8 +257,8 @@ jobs:
# therefore we need to use the nightly one.
# TODO: Once we have a way to load images into GKE, we can use the local image.
# KTF issue that should enable it: https://github.com/Kong/kubernetes-testing-framework/issues/587
TEST_CONTROLLER_IMAGE: "kong/nightly-ingress-controller"
TEST_CONTROLLER_TAG: "nightly"
TEST_CONTROLLER_IMAGE: ${{ steps.split.outputs.kic-image }}
TEST_CONTROLLER_TAG: ${{ steps.split.outputs.kic-tag }}
TEST_KONG_IMAGE: ${{ steps.split.outputs.kong-image }}
TEST_KONG_TAG: ${{ steps.split.outputs.kong-tag }}
TEST_KONG_EFFECTIVE_VERSION: ${{ inputs.kong-effective-version }}
Expand Down

0 comments on commit c656251

Please sign in to comment.