Skip to content

Commit

Permalink
Add pull secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
dsimansk committed Oct 17, 2023
1 parent bef5686 commit 77172d0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-e2e-oncluster-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-e2e-oncluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions hack/install-pull-secrets.sh
Original file line number Diff line number Diff line change
@@ -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 <<EOF > "${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 "$@"

0 comments on commit 77172d0

Please sign in to comment.