Use cgi response code as error check point #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The motivation of this pull request are the following:
1 - For some reason, the response from cgi-fcgi had a different header size in case of the path was non-existent, in this way, even 404 responses weren't failing, since
tail +5
was suppressing the response message as well.2 - Checking only the response message could reduce the customizability of the script, that also could be used to check other endpoint instead only the fpm-status page, so in case this healthz page would reply something as 400, 500 or 503 for example, it wouldn't be possible to fail the health check.
In this way, the changes done substituted a single check for failed responses message, to a verification of failed response codes, in compliance of Kubernetes probe failure requirements.(https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
Changes