[proxy] robustness tweak for liveness probe
"wc -l foo" output has two columns causing subtle breakage that shows up as sporadic cryptic errors at times Change-Id: I1f708ed011a48a2fbca6af8f4d021005d2296bfd
This commit is contained in:
parent
146a9a5b8e
commit
ec41efcb4b
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -eu
|
||||
|
||||
IPTS_DIR=/tmp/liveness
|
||||
|
||||
@ -20,7 +20,7 @@ fi
|
||||
mkdir -p "${IPTS_DIR}"
|
||||
iptables-save {{- if .Values.livenessProbe.whitelist }} | grep -Ev "${WHITELIST}" {{- end }} | grep -s 'has no endpoints' | sort > "${IPTS_DIR}/current"
|
||||
|
||||
if [[ $(wc -l "${IPTS_DIR}/current") -gt 0 ]]; then
|
||||
if [[ $(wc -l < "${IPTS_DIR}/current") -gt 0 ]]; then
|
||||
if [[ "${IPTS_DIR}/previous" ]]; then
|
||||
if cmp "${IPTS_DIR}/current" "${IPTS_DIR}/previous"; then
|
||||
echo Some non-whitelisted services have no endpoints:
|
||||
|
Loading…
x
Reference in New Issue
Block a user