HTTP Type Health Readiness Check Update#4891
HTTP Type Health Readiness Check Update#4891PeteLevineA wants to merge 2 commits intocloudfoundry:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Diego LRP health/readiness check generation so that when the check type is HTTP, only the first exposed port is used (avoiding extra monitor actions and extra TCP checks for additional exposed ports, particularly relevant for Docker images with multiple EXPOSE ports).
Changes:
- Limit liveness/startup health check ports to the first port when
health_check_typeis HTTP. - Limit readiness check ports to the first port when
readiness_health_check_typeis HTTP. - Update unit specs to assert only one monitor action/check is produced for HTTP types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/cloud_controller/diego/app_recipe_builder.rb | Introduces port-selection helpers to restrict HTTP health/readiness checks to the first port only. |
| spec/unit/lib/cloud_controller/diego/app_recipe_builder_spec.rb | Updates expectations to ensure no additional monitor actions or TCP check definitions are created for extra ports under HTTP. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
spec/unit/lib/cloud_controller/diego/app_recipe_builder_spec.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Looking at the existing code we have some questions that might impact this PR. Secondly, when the ports are set, along with docker, it looks like we always take the ports set first, then append the docker ports if they're available in the docker file under the expose directive |
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
A short explanation of the proposed change:
When the health check type is http, only the first port is used, since that's the port the HTTP endpoint check targets.
An explanation of the use cases your change solves
There's an issue with docker based applications pushed to cloud foundry that, even when health check is set to http, the health check uses all of the EXPOSE directive ports for the health readiness check. This fix updates this behavior only for the check type of http.
An example of this behavior can be found when cf pushing an application where the expose directive has multiple ports.
cf push airflow-test --docker-image public.ecr.aws/bitnami/airflow:latest -u http --endpoint / -m 2G -k 2G
The docker file in question: https://github.com/bitnami/containers/blob/ed27edbd553afff57e7383879d740299cb50e3f6/bitnami/airflow/3/debian-12/Dockerfile
Notice the application fails on health checks for each EXPOSE directive declared port.
Links to any other associated PRs
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests