File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ set -o pipefail
4+ set -o errexit
5+ set -o nounset
6+ set -o errtrace
37set -x
48
59export KUBECONFIG=/opt/kubeconfig
@@ -9,19 +13,19 @@ if [ ! -f /opt/crc/pass_kubeadmin ]; then
913 exit 1
1014fi
1115
12- PASS_KUBEADMIN=" $( cat /opt/crc/pass_kubeadmin) "
13-
1416rm -rf /tmp/.crc-cluster-ready
1517
1618if ! oc adm wait-for-stable-cluster --minimum-stable-period=1m --timeout=10m; then
1719 exit 1
1820fi
1921
20- set +x
22+
2123echo " Logging into OpenShift with kubeadmin user to update $KUBECONFIG "
2224COUNTER=1
2325MAXIMUM_LOGIN_RETRY=10
24- until oc login --insecure-skip-tls-verify=true -u kubeadmin -p " $PASS_KUBEADMIN " https://api.crc.testing:6443 > /dev/null 2>&1 ; do
26+
27+ # use a `(set +x)` subshell to avoid leaking the password
28+ until (set +x ; oc login --insecure-skip-tls-verify=true -u kubeadmin -p " $( cat /opt/crc/pass_kubeadmin) " https://api.crc.testing:6443 > /dev/null 2>&1 ); do
2529 if [ " $COUNTER " -ge " $MAXIMUM_LOGIN_RETRY " ]; then
2630 echo " Unable to login to the cluster..., authentication failed."
2731 exit 1
3337
3438# need to set a marker to let `crc` know the cluster is ready
3539touch /tmp/.crc-cluster-ready
36-
You can’t perform that action at this time.
0 commit comments