Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[kibana] Explicitly test for a 200 for readinessProbe
Browse files Browse the repository at this point in the history
If authentication wasn't configured correctly the Kibana readinessProbe
would still pass since `curl --fail` doesn't consider a redirect to be a
failure. If authentication fails Kibana would redirect you back to the
login page so this readinessProbe always passed for security clusters.
The tests are going to fail until #272 is merged and this PR has been
rebased on top of it.
  • Loading branch information
Crazybus committed Sep 19, 2019
1 parent 09501fe commit 59e1372
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ spec:
set -- "$@" -u "${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}"
fi
curl -k "$@" "{{ .Values.protocol }}://localhost:{{ .Values.httpPort }}${path}"
STATUS=$(curl --output /dev/null --write-out "%{http_code}" -k "$@" "{{ .Values.protocol }}://localhost:{{ .Values.httpPort }}${path}")
if [[ "${STATUS}" -eq 200 ]]; then
exit 0
fi
echo "Error: Got HTTP code ${STATUS} but expected a 200"
exit 1
}
http "{{ .Values.healthCheckPath }}"
Expand Down

0 comments on commit 59e1372

Please sign in to comment.