diff --git a/.github/workflows/test-e2e-oncluster-runtime.yaml b/.github/workflows/test-e2e-oncluster-runtime.yaml index 0bc1f452e8..89cc116e27 100644 --- a/.github/workflows/test-e2e-oncluster-runtime.yaml +++ b/.github/workflows/test-e2e-oncluster-runtime.yaml @@ -22,6 +22,11 @@ jobs: run: ./hack/create-testing-func-image.sh - name: Allocate Cluster run: ./hack/allocate.sh + - name: Install RH pull secrets for KinD cluster + env: + RH_REG_USR: ${{ secrets.RH_REG_USR }} + RH_REG_PWD: ${{ secrets.RH_REG_PWD }} + run: ./hack/install-pull-secrets.sh - name: Deploy Tekton run: ./hack/tekton.sh - name: Deploy Test Git Server diff --git a/.github/workflows/test-e2e-oncluster.yaml b/.github/workflows/test-e2e-oncluster.yaml index b1a43929a8..766233d72d 100644 --- a/.github/workflows/test-e2e-oncluster.yaml +++ b/.github/workflows/test-e2e-oncluster.yaml @@ -22,6 +22,11 @@ jobs: run: ./hack/create-testing-func-image.sh - name: Allocate Cluster run: ./hack/allocate.sh + - name: Install RH pull secrets for KinD cluster + env: + RH_REG_USR: ${{ secrets.RH_REG_USR }} + RH_REG_PWD: ${{ secrets.RH_REG_PWD }} + run: ./hack/install-pull-secrets.sh - name: Deploy Tekton run: ./hack/tekton.sh - name: Deploy Test Git Server diff --git a/hack/install-pull-secrets.sh b/hack/install-pull-secrets.sh new file mode 100755 index 0000000000..33ac051c67 --- /dev/null +++ b/hack/install-pull-secrets.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +main() { + local -r tmp_docker_config="$(mktemp config.json-XXXXXXXX)" + + cat < "${tmp_docker_config}" +{ + "auths": { + "registry.redhat.io": { + "auth": "$(echo -n "${RH_REG_USR}:${RH_REG_PWD}" | base64 -w0)" + } + } +} +EOF + + local node + for node in $(kind get nodes --name "func"); do + tar -cf - "${tmp_docker_config}" --transform="flags=r;s|${tmp_docker_config}|config.json|" | \ + docker cp - "${node}:/var/lib/kubelet/" + done + rm "${tmp_docker_config}" +} + +main "$@"