@@ -336,6 +336,14 @@ jobs:
336336 - name : Set Environment Variables
337337 uses : ./.github/actions/set-env-variables
338338
339+ - name : Login to docker registry for CI image pull
340+ if : ${{ vars.DOCKER_AUTH_REQUIRED == 'true' }}
341+ uses : docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
342+ with :
343+ registry : ${{ vars.DOCKER_READ_HOST }}
344+ username : ${{ vars.DOCKER_READ_USERNAME }}
345+ password : ${{ secrets.DOCKER_READ_PASSWORD }}
346+
339347 # Warning: since this is a privileged workflow, subsequent workflow job
340348 # steps must take care not to execute untrusted code.
341349 - name : Checkout pull request branch (NOT TRUSTED)
@@ -412,6 +420,18 @@ jobs:
412420 fi
413421 git config --add safe.directory /cilium
414422
423+ - name : Create imagePullSecret for ginkgo image pull
424+ if : ${{ vars.DOCKER_AUTH_REQUIRED == 'true' }}
425+ uses : cilium/little-vm-helper@5ae749011735fd77f30f38add52f1a53a5568671 # v0.0.30
426+ with :
427+ provision : ' false'
428+ cmd : |
429+ kubectl create secret docker-registry cilium-registry \
430+ --namespace kube-system \
431+ --docker-server=${{ vars.DOCKER_READ_HOST }} \
432+ --docker-username="${{ vars.DOCKER_READ_USERNAME }}" \
433+ --docker-password="${{ secrets.DOCKER_READ_PASSWORD }}"
434+
415435 # Load Ginkgo build from GitHub
416436 - name : Load ${{ matrix.name }} Ginkgo build from GitHub
417437 uses : actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -492,6 +512,11 @@ jobs:
492512 export RACE=1
493513 export LOCKDEBUG=1
494514 fi
515+ # Only pass the imagePullSecrets helm override when registry auth is required.
516+ HELM_OVERRIDES=""
517+ if [[ "${{ vars.DOCKER_AUTH_REQUIRED }}" == "true" ]]; then
518+ HELM_OVERRIDES="-cilium.install-helm-overrides=imagePullSecrets[0].name=cilium-registry"
519+ fi
495520 echo "/root/go/bin/ginkgo \
496521 --focus=\"${{ matrix.cliFocus }}\" \
497522 --skip=\"${{ matrix.cliSkip }}\" \
@@ -504,7 +529,8 @@ jobs:
504529 -cilium.hubble-relay-image=${{ env.REGISTRY_DEV }}/${{ env.ORGANIZATION_DEV }}/hubble-relay-ci \
505530 -cilium.hubble-relay-tag=${{ needs.setup-vars.outputs.SHA }}${{ needs.setup-vars.outputs.image_tag_suffix }} \
506531 -cilium.kubeconfig=/root/.kube/config \
507- -cilium.operator-suffix=-ci ${{ env.CILIUM_GINKGO_EXTRA_ARGS }}"
532+ ${HELM_OVERRIDES} \
533+ -cilium.operator-suffix=-ci"
508534
509535 ./test.test \
510536 --ginkgo.focus="${{ matrix.cliFocus }}" \
@@ -518,7 +544,8 @@ jobs:
518544 -cilium.hubble-relay-image=${{ env.REGISTRY_DEV }}/${{ env.ORGANIZATION_DEV }}/hubble-relay-ci \
519545 -cilium.hubble-relay-tag=${{ needs.setup-vars.outputs.SHA }}${{ needs.setup-vars.outputs.image_tag_suffix }} \
520546 -cilium.kubeconfig=/root/.kube/config \
521- -cilium.operator-suffix=-ci ${{ env.CILIUM_GINKGO_EXTRA_ARGS }}
547+ ${HELM_OVERRIDES} \
548+ -cilium.operator-suffix=-ci
522549
523550 - name : Fetch artifacts
524551 if : ${{ !success() && steps.provision-vh-vms.outcome == 'success' }}
0 commit comments