Skip to content

Commit

Permalink
Fix kube-rbac-proxy startup scripts
Browse files Browse the repository at this point in the history
When the cert wasn't available yet the script would crash with a
python json-parsing error rather than looping like it was supposed to.
  • Loading branch information
danwinship committed Oct 4, 2020
1 parent af1f2ed commit cfbd570
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bindata/network/openshift-sdn/sdn.yaml
Expand Up @@ -200,9 +200,9 @@ spec:
--cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
"https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/api/v1/namespaces/openshift-sdn/services/sdn" |
python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["creationTimestamp"])'
python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["creationTimestamp"])' 2>/dev/null || true
)
if [ ! -z "TS" ]; then
if [ -n "${TS}" ]; then
break
fi
(( retries += 1 ))
Expand Down
4 changes: 2 additions & 2 deletions bindata/network/ovn-kubernetes/ovnkube-master.yaml
Expand Up @@ -456,9 +456,9 @@ spec:
--cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
"https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/api/v1/namespaces/ovn-kubernetes/services/ovnkube-master" |
python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["creationTimestamp"])'
python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["creationTimestamp"])' 2>/dev/null || true
) || :
if [ ! -z "TS" ]; then
if [ -n "${TS}" ]; then
break
fi
(( retries += 1 ))
Expand Down
4 changes: 2 additions & 2 deletions bindata/network/ovn-kubernetes/ovnkube-node.yaml
Expand Up @@ -105,9 +105,9 @@ spec:
--cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \
-H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
"https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/api/v1/namespaces/ovn-kubernetes/services/ovnkube-node" |
python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["creationTimestamp"])'
python -c 'import json,sys; print(json.load(sys.stdin)["metadata"]["creationTimestamp"])' 2>/dev/null || true
) || :
if [ ! -z "TS" ]; then
if [ -n "${TS}" ]; then
break
fi
(( retries += 1 ))
Expand Down

0 comments on commit cfbd570

Please sign in to comment.