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

healthcheck: stop showing wrong status when --no-healthcheck is set #13585

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

flouthoc
Copy link
Collaborator

Containers started with --no-healthcheck are configured to contain no
health-check and test configured as NONE. Podman shows wrong status as
such use cases.

Following commit fixes the faulty behavior of stauts field for
containers started with --no-healthcheck

Closes: #13578

Containers started with `--no-healthcheck` are configured to contain no
healthcheck and test configured as `NONE`. Podman shows wrong status as
such use cases.

Following commit fixes the faulty behavior of stauts field for
containers started with `--no-healthcheck`

Signed-off-by: Aditya R <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 22, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 22, 2022
// Check if healthcheck is not nil and --no-healthcheck option is not set.
// If --no-healthcheck is set Test will be always set to `[NONE]` so no need
// to update status in such case.
if c.config.HealthCheckConfig != nil && !(len(c.config.HealthCheckConfig.Test) == 1 && c.config.HealthCheckConfig.Test[0] == "NONE") {
Copy link
Member

Choose a reason for hiding this comment

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

Could len(c.config.HealthCheckConfig.Test) > 1 and still have a value somewhere of "none"? If so what should we do there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rhatdan Then most likely its manually done by user and its not set via --no-healthcheck so that case should not be treated as equivalent to --no-healthcheck IMO.

Copy link
Member

Choose a reason for hiding this comment

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

Should --no-healthcheck conflict with --health-cmd then?

Copy link
Member

Choose a reason for hiding this comment

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

yes, but that check should probably be much much further up the stack imho

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@baude is correct I think we already have a conflict check for that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@flouthoc flouthoc requested review from rhatdan and baude March 22, 2022 12:07
@mheon
Copy link
Member

mheon commented Mar 22, 2022

LGTM

@rhatdan
Copy link
Member

rhatdan commented Mar 22, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2022
@openshift-merge-robot openshift-merge-robot merged commit 02aae4a into containers:main Mar 22, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Healthcheck always shows "starting" when disabled with --no-healthcheck
5 participants