From fb6fdcc413522e612866febe6e407e7893f7ee2f Mon Sep 17 00:00:00 2001 From: praveenkumar Date: Wed, 28 Jul 2021 14:01:33 +0530 Subject: [PATCH] Separate retry with pipe operations This patch will fix following CI failure. ``` + retry ./openshift-clients/linux/oc get secrets -n openshift-authentication v4-0-config-system-ocp-branding-template -o json + local retries=10 + local count=0 + jq -r '.data["login.html"]' + ./openshift-clients/linux/oc get secrets -n openshift-authentication v4-0-config-system-ocp-branding-template -o json + base64 -d The connection to the server api.crc.testing:6443 was refused - did you specify the right host or port? + exit=1 + wait=1 + count=1 + '[' 1 -lt 10 ']' + echo 'Retry 1/10 exited 1, retrying in 1 seconds...' + sleep 1 parse error: Invalid numeric literal at line 1, column 6 ``` --- snc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snc.sh b/snc.sh index 0e7d9b3df..846414959 100755 --- a/snc.sh +++ b/snc.sh @@ -191,7 +191,8 @@ retry ${OC} scale --replicas=1 ingresscontroller/default -n openshift-ingress-op retry ${OC} patch config.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge # Add a tip in the login page -retry ${OC} get secrets -n openshift-authentication v4-0-config-system-ocp-branding-template -o json | ${JQ} -r '.data["login.html"]' | base64 -d > login.html +retry ${OC} get secrets -n openshift-authentication v4-0-config-system-ocp-branding-template -o json > tmp_secret_template.json +${JQ} -r '.data["login.html"]' tmp_secret_template.json | base64 -d > login.html ${PATCH} login.html < login.html.patch retry ${OC} create secret generic login-template --from-file=login.html -n openshift-config