Skip to content

Commit

Permalink
Merge pull request coreos#774 from cheesesashimi/zzlotnik/fix-cluster…
Browse files Browse the repository at this point in the history
…-context

ci: remember test cluster context
  • Loading branch information
openshift-merge-robot committed Apr 8, 2022
2 parents 326e949 + 7234a80 commit 50cdee6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ci/derived-image-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@

set -euo pipefail

# Note: The oc binary will be injected by the Prow CI process. It
# is not present in ci/Dockerfile.
oc login https://api.ci.l2s4.p1.openshiftapps.com:6443 --token="$(cat /service-account-token/image-pusher-service-account-token)"
oc registry login --registry=registry.ci.openshift.org --to="$SHARED_DIR/dockercfg.json"
# Notes:
# - The oc binary will be injected by the Prow CI process. It is not present in
# ci/Dockerfile.
# - When we log into the main CI cluster to get the registry creds, oc mutates
# the kubeconfig for the ephemeral cluster we run our derived image tests
# against. We temporarily set $KUBECONFIG to an empty file so that file gets
# mutated during the login phase.
tmp_kubeconfig="$(mktemp)"
KUBECONFIG="$tmp_kubeconfig" oc login https://api.ci.l2s4.p1.openshiftapps.com:6443 --token="$(cat /service-account-token/image-pusher-service-account-token)"
KUBECONFIG="$tmp_kubeconfig" oc registry login --registry=registry.ci.openshift.org --to="$SHARED_DIR/dockercfg.json";

export COSA_DIR="/tmp/cosa"
mkdir -p "$COSA_DIR"
Expand Down

0 comments on commit 50cdee6

Please sign in to comment.