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

Fail earlier when no containers exist in stats #22707

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented May 14, 2024

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 14, 2024
@rhatdan
Copy link
Member Author

rhatdan commented May 14, 2024

@edsantiago PTAL

@edsantiago
Copy link
Collaborator

LGTM! Thank you!

@rhatdan
Copy link
Member Author

rhatdan commented May 14, 2024

Fixes: #22612

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

Copy link

Cockpit tests failed for commit 5cf82c6. @martinpitt, @jelly, @mvollmer please check.

@@ -25,10 +25,6 @@ var _ = Describe("Podman stats", func() {
session := podmanTest.Podman([]string{"stats", "--no-stream", "123"})
session.WaitWithDefaultTimeout()
expect := `unable to get list of containers: unable to look up container 123: no container with name or ID "123" found: no such container`
Copy link
Collaborator

Choose a reason for hiding this comment

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

As long as you have to repush, though, might as well move the string below into ExitWithError(), and get rid of the temporary variable...

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.

This is changing the behavior, if you get the list of containers before the loop it will not update on each inteerval which means newly created contianer will not be added later which is wrong.

The proper way to fix is doing something like this for stats as well. #22691

@rhatdan rhatdan force-pushed the stats branch 2 times, most recently from 026052f to 0851695 Compare May 15, 2024 11:09
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label May 15, 2024
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

Copy link

Cockpit tests failed for commit 026052f. @martinpitt, @jelly, @mvollmer please check.

Copy link

Cockpit tests failed for commit 0851695. @martinpitt, @jelly, @mvollmer please check.

@rhatdan rhatdan force-pushed the stats branch 2 times, most recently from 23d9c2b to 8e7cc2e Compare May 15, 2024 11:40
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

Copy link

Cockpit tests failed for commit 23d9c2b. @martinpitt, @jelly, @mvollmer please check.

Copy link

Cockpit tests failed for commit 8e7cc2e. @martinpitt, @jelly, @mvollmer please check.

@lsm5
Copy link
Member

lsm5 commented May 15, 2024

The ELN copr environment fixes should land today/tomorrow so ignore failures for now.

@lsm5
Copy link
Member

lsm5 commented May 15, 2024

@martinpitt the cockpit tests on rawhide have been failing consistently recently. PTAL.

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@jelly
Copy link
Contributor

jelly commented May 16, 2024

@martinpitt the cockpit tests on rawhide have been failing consistently recently. PTAL.

Hey, sorry we had some issues with the new systemd release landing in rawhide. The tests should run now.

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.

API tests are failing,
unable to look up container [$cid] looks like a bug in the tests, a caliss case of not checking the output/error message.

pkg/api/handlers/libpod/containers_stats.go Outdated Show resolved Hide resolved
@rhatdan rhatdan force-pushed the stats branch 3 times, most recently from 6965b8c to 1e1df0f Compare May 16, 2024 19:13
@rhatdan
Copy link
Member Author

rhatdan commented May 20, 2024

@Luap99 PTAL

test/apiv2/20-containers.at Outdated Show resolved Hide resolved
else
t GET libpod/containers/stats?containers='[$cid]' 409
t GET "libpod/containers/stats?containers=$cid&stream=false" 200
Copy link
Member

Choose a reason for hiding this comment

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

I guess this still returns 409 for cgroup v1, we just don't test cgroupv1 in CI for the pai tests so we don't notice I guess and we in the process of dropping all cgroupv1 testing so I guess you might as well just drop all the conditionals

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
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.

LGTM

Copy link
Contributor

openshift-ci bot commented May 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, 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

@baude
Copy link
Member

baude commented Jun 3, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 241821b into containers:main Jun 3, 2024
86 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Change to remote API; merits scrutiny lgtm Indicates that a PR is ready to be merged. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants