Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cgi response code as error check point #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fernandesGabriel
Copy link

@fernandesGabriel fernandesGabriel commented Jun 19, 2020

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

  • Tests included
  • Documentation updated
  • Commit message is clear

Copy link
Owner

@renatomefi renatomefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @fernandesGabriel,

Thanks for this contribution, I think it's a good addition to the script!

I added some comments, and could you please also add tests for the change?

Thanks again!

php-fpm-healthcheck Show resolved Hide resolved
php-fpm-healthcheck Outdated Show resolved Hide resolved
@renatomefi renatomefi added this to the v0.6.0 milestone Jul 6, 2020
@renatomefi renatomefi added the enhancement New feature or request label Jul 6, 2020
@fernandesGabriel
Copy link
Author

Hi @renatomefi

Sorry for the long time to reply you. I will take a look on your messages, as well as why the tests haven't passed.

@fernandesGabriel
Copy link
Author

@renatomefi I have updated this branch as my user was associated with my work email. Also made some minor adjustments. Please review and let me know if there is anything I should change. Tests are commented out as it would require a #38 to make it work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants