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

Fix guacrest docker compose healthchecks #2001

Conversation

nchelluri
Copy link
Contributor

@nchelluri nchelluri commented Jul 5, 2024

Description of the PR

In main right now, if you run make container followed by make start-service from the root dir, or GUAC_IMAGE=local-organic-guac docker compose -f guac-demo-compose.yaml up --force-recreate from the container_files dir, and then run docker ps, guacrest will be reported as unhealthy.

This is because the healthcheck uses the wget's --spider flag which makes a HEAD request. But the OpenAPI spec for guacrest does not allow for that method. So I changed the healthcheck command to use the wget's -O- flag instead, which makes a GET request (and doesn't create a file with the response body - which would happen without any -O flag - but instead prints it to standard out).

After my commits, I retested the above docker compose commands and in both cases docker ps shows guacrest as healthy.

fixes #2002

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If GraphQL schema is changed, GraphQL client updates/additions have been made
  • If OpenAPI spec is changed, make generate has been run
  • If ent schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

- The health check was trying to use the HEAD method,
  but guacrest's /healthz endpoint only supports GET.
  So we just switch it to use HEAD.

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
@pxp928
Copy link
Collaborator

pxp928 commented Jul 7, 2024

fixes #2002

Copy link
Collaborator

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks

@kodiakhq kodiakhq bot merged commit 41970b6 into guacsec:main Jul 7, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Health check for guac rest docker is broken
3 participants