Skip to content

Commit

Permalink
Separate retry with pipe operations
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
praveenkumar committed Aug 2, 2021
1 parent 38e2f7f commit fb6fdcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fb6fdcc

Please sign in to comment.