Skip to content

HTTP Type Health Readiness Check Update#4891

Open
PeteLevineA wants to merge 2 commits intocloudfoundry:mainfrom
PeteLevineA:health-check-endpoint-docker
Open

HTTP Type Health Readiness Check Update#4891
PeteLevineA wants to merge 2 commits intocloudfoundry:mainfrom
PeteLevineA:health-check-endpoint-docker

Conversation

@PeteLevineA
Copy link
Member

@PeteLevineA PeteLevineA commented Feb 27, 2026

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 main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Copilot AI review requested due to automatic review settings February 27, 2026 17:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_type is HTTP.
  • Limit readiness check ports to the first port when readiness_health_check_type is 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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@PeteLevineA
Copy link
Member Author

Looking at the existing code we have some questions that might impact this PR.
extra_args << "-uri=#{process.health_check_http_endpoint}" if process.health_check_type == HealthCheckTypes::HTTP && index == 0
Indicates that we always check index 0 when http type.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants