@@ -134,6 +134,25 @@ jobs:
134134 with :
135135 password : ${{ secrets.PULP_PASSWORD }}
136136
137+ - name : split image and tag
138+ id : split
139+ env :
140+ KONG : ${{ inputs.kong-image }}
141+ CONTROLLER : ${{ inputs.controller-image }}
142+ run : |
143+ if [ "${{ inputs.kong-image }}" != "" ]; then
144+ export kong_image=$(echo ${{ inputs.kong-image }} | awk '{split($0,a,":"); print a[1]}')
145+ export kong_tag=$(echo ${{ inputs.kong-image }} | awk '{split($0,a,":"); print a[2]}')
146+ echo "kong-image=$kong_image" >> $GITHUB_OUTPUT
147+ echo "kong-tag=$kong_tag" >> $GITHUB_OUTPUT
148+ fi
149+ if [ "${{ inputs.kic-image }}" != "" ]; then
150+ export kic_image=$(echo ${{ inputs.kic-image }} | awk '{split($0,a,":"); print a[1]}')
151+ export kic_tag=$(echo ${{ inputs.kic-image }} | awk '{split($0,a,":"); print a[2]}')
152+ echo "kic-image=$kic_image" >> $GITHUB_OUTPUT
153+ echo "kic-tag=$kic_tag" >> $GITHUB_OUTPUT
154+ fi
155+
137156 # We need to pull the Gateway image locally if loading local image was specified.
138157 # This is a "workaround" of the fact that we bind the env variable - responsible for
139158 # indicating whether we'd like to load the images - for both controller
@@ -149,9 +168,11 @@ jobs:
149168 env :
150169 E2E_TEST_RUN : ${{ matrix.test }}
151170 KONG_CLUSTER_VERSION : ${{ matrix.kubernetes-version }}
152- TEST_KONG_CONTROLLER_IMAGE_OVERRIDE : ${{ inputs.kic-image }}
171+ TEST_CONTROLLER_IMAGE : ${{ steps.split.outputs.kic-image }}
172+ TEST_CONTROLLER_TAG : ${{ steps.split.outputs.kic-tag }}
153173 TEST_KONG_LOAD_IMAGES : ${{ inputs.load-local-image }}
154- TEST_KONG_IMAGE_OVERRIDE : ${{ inputs.kong-image }}
174+ TEST_KONG_IMAGE : ${{ steps.split.outputs.kong-image }}
175+ TEST_KONG_TAG : ${{ steps.split.outputs.kong-tag }}
155176 TEST_KONG_KONNECT_ACCESS_TOKEN : ${{ secrets.K8S_TEAM_KONNECT_ACCESS_TOKEN }}
156177 KONG_LICENSE_DATA : ${{ steps.license.outputs.license }}
157178 GOTESTSUM_JUNITFILE : " e2e-${{ matrix.test }}${{ matrix.kubernetes-version }}-tests.xml"
@@ -199,20 +220,37 @@ jobs:
199220 with :
200221 password : ${{ secrets.PULP_PASSWORD }}
201222
223+ - name : split image and tag
224+ id : split
225+ env :
226+ KONG : ${{ inputs.kong-image }}
227+ CONTROLLER : ${{ inputs.controller-image }}
228+ run : |
229+ if [ "${{ inputs.kong-image }}" != "" ]; then
230+ export kong_image=$(echo ${{ inputs.kong-image }} | awk '{split($0,a,":"); print a[1]}')
231+ export kong_tag=$(echo ${{ inputs.kong-image }} | awk '{split($0,a,":"); print a[2]}')
232+ echo "kong-image=$kong_image" >> $GITHUB_OUTPUT
233+ echo "kong-tag=$kong_tag" >> $GITHUB_OUTPUT
234+ fi
235+ # see the https://github.com/Kong/kubernetes-testing-framework/issues/587 TODO below
236+ # if we add local image GKE support, we probably need to split it into components here
237+
202238 - name : run ${{ matrix.test }}
203239 run : make test.e2e
204240 env :
205241 # NOTE: The limitation of the GKE setup is that we cannot run tests against a local image,
206242 # therefore we need to use the nightly one.
207243 # TODO: Once we have a way to load images into GKE, we can use the local image.
208244 # KTF issue that should enable it: https://github.com/Kong/kubernetes-testing-framework/issues/587
209- TEST_KONG_CONTROLLER_IMAGE_OVERRIDE : " kong/nightly-ingress-controller:nightly"
210- TEST_KONG_IMAGE_OVERRIDE : ${{ inputs.kong-image }}
245+ TEST_CONTROLLER_IMAGE : " kong/nightly-ingress-controller"
246+ TEST_CONTROLLER_TAG : " nightly"
247+ TEST_KONG_IMAGE : ${{ steps.split.outputs.kong-image }}
248+ TEST_KONG_TAG : ${{ steps.split.outputs.kong-tag }}
211249 TEST_KONG_EFFECTIVE_VERSION : ${{ inputs.kong-effective-version }}
212250 KONG_LICENSE_DATA : ${{ steps.license.outputs.license }}
213251 TEST_KONG_KONNECT_ACCESS_TOKEN : ${{ secrets.K8S_TEAM_KONNECT_ACCESS_TOKEN }}
214252 KONG_CLUSTER_VERSION : ${{ matrix.kubernetes-version }}
215- KONG_TEST_CLUSTER_PROVIDER : gke
253+ KONG_CLUSTER_PROVIDER : gke
216254 E2E_TEST_RUN : ${{ matrix.test }}
217255 GOTESTSUM_JUNITFILE : " e2e-gke-${{ matrix.test }}-${{ matrix.kubernetes-version }}-tests.xml"
218256 GOOGLE_APPLICATION_CREDENTIALS : ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
@@ -270,12 +308,34 @@ jobs:
270308 with :
271309 password : ${{ secrets.PULP_PASSWORD }}
272310
311+ - name : split image and tag
312+ id : split
313+ env :
314+ KONG : ${{ inputs.kong-image }}
315+ CONTROLLER : ${{ inputs.controller-image }}
316+ run : |
317+ if [ "${{ inputs.kong-image }}" != "" ]; then
318+ export kong_image=$(echo ${{ inputs.kong-image }} | awk '{split($0,a,":"); print a[1]}')
319+ export kong_tag=$(echo ${{ inputs.kong-image }} | awk '{split($0,a,":"); print a[2]}')
320+ echo "kong-image=$kong_image" >> $GITHUB_OUTPUT
321+ echo "kong-tag=$kong_tag" >> $GITHUB_OUTPUT
322+ fi
323+ if [ "${{ inputs.kic-image }}" != "" ]; then
324+ export kic_image=$(echo ${{ inputs.kic-image }} | awk '{split($0,a,":"); print a[1]}')
325+ export kic_tag=$(echo ${{ inputs.kic-image }} | awk '{split($0,a,":"); print a[2]}')
326+ echo "kic-image=$kic_image" >> $GITHUB_OUTPUT
327+ echo "kic-tag=$kic_tag" >> $GITHUB_OUTPUT
328+ fi
329+
330+
273331 - name : run Istio tests
274332 run : make test.istio
275333 env :
276- TEST_KONG_CONTROLLER_IMAGE_OVERRIDE : ${{ inputs.kic-image }}
334+ TEST_CONTROLLER_IMAGE : ${{ steps.split.outputs.kic-image }}
335+ TEST_CONTROLLER_TAG : ${{ steps.split.outputs.kic-tag }}
277336 TEST_KONG_LOAD_IMAGES : ${{ inputs.load-local-image }}
278- TEST_KONG_IMAGE_OVERRIDE : ${{ inputs.kong-image }}
337+ TEST_KONG_IMAGE : ${{ steps.split.outputs.kong-image }}
338+ TEST_KONG_TAG : ${{ steps.split.outputs.kong-tag }}
279339 KONG_LICENSE_DATA : ${{ steps.license.outputs.license }}
280340 KONG_CLUSTER_VERSION : ${{ matrix.kind }}
281341 ISTIO_VERSION : ${{ matrix.istio }}
0 commit comments