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

Edited compat handling code for containers/json status and added python tests #10610

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

cdoern
Copy link
Contributor

@cdoern cdoern commented Jun 9, 2021

Signed-off-by: cdoern [email protected]

Health Check is not handled in the compat LibpodToContainerJSON function within containers.go. Added parsing and handling for this status check and also edited some of the list container filter code.

fixes #10457

@cdoern cdoern force-pushed the healthCheck branch 3 times, most recently from a21fcc3 to 2e61416 Compare June 9, 2021 14:36
@cdoern cdoern requested a review from Luap99 June 9, 2021 18:32
@cdoern cdoern changed the title Added Filter query param for containers/json as well as python tests Edited compat handling code for containers/json status and added python tests Jun 9, 2021
@mheon
Copy link
Member

mheon commented Jun 10, 2021

Does this actually fix #10457 - I don't see any HC-related changes, just filter ones?

@cdoern
Copy link
Contributor Author

cdoern commented Jun 10, 2021

@mheon I am pretty sure the issue is originating with the lack of handling for both status and health filters in the compat code upon inspect. I am planning on taking another look in the morning specifically at the Health filter to see if that is also just not handled.

@Luap99
Copy link
Member

Luap99 commented Jun 10, 2021

@cdoern I just noticed, could please include the PR description in the commit message. Also the fixes #123 should be in the commit message. This makes it easier to track the commits in the local git history and the sign-off-by line should include your real name not the nick.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

You say this fixes #10457 but I don't see why this would fix it. There is no test for #10457

pkg/api/handlers/compat/containers.go Outdated Show resolved Hide resolved
@cdoern
Copy link
Contributor Author

cdoern commented Jun 10, 2021

@cdoern I just noticed, could please include the PR description in the commit message. Also the fixes #123 should be in the commit message. This makes it easier to track the commits in the local git history and the sign-off-by line should include your real name not the nick.

will do, sorry for the formatting issues

@cdoern
Copy link
Contributor Author

cdoern commented Jun 10, 2021

You say this fixes #10457 but I don't see why this would fix it. There is no test for #10457

Added further fixing for health check specifically in most recent commit.

@cdoern cdoern force-pushed the healthCheck branch 2 times, most recently from 6150de2 to 5057b12 Compare June 10, 2021 12:42
@cdoern cdoern force-pushed the healthCheck branch 6 times, most recently from 9f8d37c to b54f151 Compare June 10, 2021 16:40
@cdoern cdoern requested a review from mheon June 11, 2021 12:38
@TomSweeneyRedHat
Copy link
Member

@edsantiago can you take a peak at the failing test here? It's failing on a bad release version and I don't see any changes here that should have triggered that.

@edsantiago
Copy link
Member

This test should never run. I have to assume that someone manually pressed the 'Trigger' button. Whoever did that, live and learn, don't do it again.

You can ignore the test result. It does not gate merging.

@cdoern
Copy link
Contributor Author

cdoern commented Jun 14, 2021

This test should never run. I have to assume that someone manually pressed the 'Trigger' button. Whoever did that, live and learn, don't do it again.

You can ignore the test result. It does not gate merging.

that was me sorry, one test failed due to a flake and cancelled all of the others so I must've accidentally restarted that one.

@edsantiago
Copy link
Member

No worries! To restart a failed test, just press the 'Re-run' link in the left-hand panel. You do not need to restart any others: once the flaked test succeeds, the others will eventually run even though the @#$% UI says "Canceled". It's completely anti-intuitive, just one of those things we have to get used to.

@cdoern cdoern requested a review from TomSweeneyRedHat June 18, 2021 13:39
@TomSweeneyRedHat
Copy link
Member

LGTM

@rhatdan
Copy link
Member

rhatdan commented Jun 23, 2021

@mheon @Luap99 PTAL

state.Health.Status = inspect.State.Healthcheck.Status
state.Health.FailingStreak = inspect.State.Healthcheck.FailingStreak

//item := define.HealthCheckLog{}
Copy link
Member

Choose a reason for hiding this comment

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

Can you trim this bit?


//item := define.HealthCheckLog{}

var res *types.HealthcheckResult = &types.HealthcheckResult{}
Copy link
Member

Choose a reason for hiding this comment

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

This looks a little dubious - why is it being created only once? I think every time the for loop below runs, you're overwriting the contents, and appending the same entry to the array again?

I would move this inside the loop for safety

log := inspect.State.Healthcheck.Log

for _, item := range log {
var res *types.HealthcheckResult = &types.HealthcheckResult{}
Copy link
Member

Choose a reason for hiding this comment

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

Can this be stated as

res:=&types.HealthcheckResult{}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, pushing that change now.

Added parsing and handling for the healthCheck status within containers.go. Also modified tests

fixes containers#10457

Signed-off-by: cdoern <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jun 23, 2021

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 23, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdoern, rhatdan

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 Jun 23, 2021
@openshift-merge-robot openshift-merge-robot merged commit b0a3ac3 into containers:master Jun 23, 2021
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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 is ignored in compose files when adding labels to volumes
7 participants