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

make podman pod inspect output a json array #21514

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Feb 5, 2024

Just like all the other inspect commands that accept multiple args we should just make podman pod inspect output a json array. This makes the code more consistent and removes the extra workaround which was needed before to support this.

Does this PR introduce a user-facing change?

podman pod inspect now outputs a json array by default just like all the other inspect commands.

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

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM
you're a PR machine at the moment :)

Copy link
Contributor

openshift-ci bot commented Feb 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, vrothberg

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

@Luap99 Luap99 added breaking-change A change that will require a full version bump, i.e. 3.* to 4.* 5.0 labels Feb 5, 2024
@rhatdan
Copy link
Member

rhatdan commented Feb 5, 2024

/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 5, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2024
Copy link

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

Just like all the other inspect commands that accept multiple args we
should just make podman pod inspect output a json array.
This makes the code more consistent and removes the extra workaround
which was needed before to support this.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2024
Copy link

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

@vrothberg
Copy link
Member

Looks like this change breaks cockpit.
@Luap99, @martinpitt, can you sync on how to move forward?

@Luap99
Copy link
Member Author

Luap99 commented Feb 6, 2024

If cockpit uses the podman pod inspect command then yes it likely breaks the json parser but because this is a intentional breaking change this is expected and good to merge as we agreed the cockpit tests are not a blocker for such changes and that they need to fix the test on their end. That however only makes sense when this PR is merged as otherwise they would break all other PRs tests.

@rhatdan
Copy link
Member

rhatdan commented Feb 6, 2024

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 6, 2024
martinpitt added a commit to martinpitt/cockpit-podman that referenced this pull request Feb 7, 2024
The "as we do not show them in the UI yet" is not true any more, the
code above does just that.

This avoids assuming that `podman inspect` returns a JSON object.
containers/podman#21514 changes it to a list, so
the test fails with "list indices must be integers or slices, not str"
with that PR.
martinpitt added a commit to martinpitt/cockpit-podman that referenced this pull request Feb 7, 2024
The "as we do not show them in the UI yet" is not true any more, the
code above does just that.

This avoids assuming that `podman inspect` returns a JSON object.
containers/podman#21514 changes it to a list, so
the test fails with "list indices must be integers or slices, not str"
with that PR.
@martinpitt
Copy link
Contributor

@Luap99 @vrothberg I sent cockpit-project/cockpit-podman#1549 to adjust cockpit's tests. It should land in the next 3 hours, then I'll ping here.

jelly pushed a commit to cockpit-project/cockpit-podman that referenced this pull request Feb 7, 2024
The "as we do not show them in the UI yet" is not true any more, the
code above does just that.

This avoids assuming that `podman inspect` returns a JSON object.
containers/podman#21514 changes it to a list, so
the test fails with "list indices must be integers or slices, not str"
with that PR.
@martinpitt
Copy link
Contributor

@Luap99 @vrothberg The cockpit PR landed, so can you please retry? They should go green now.

@vrothberg
Copy link
Member

Retriggered the jobs. That was super fast, thanks a lot, @martinpitt !

@Luap99
Copy link
Member Author

Luap99 commented Feb 8, 2024

please merge this

@vrothberg
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 4c9bd24 into containers:main Feb 8, 2024
91 of 92 checks passed
@Luap99 Luap99 deleted the pod-inspect-output branch February 8, 2024 11:37
@AdamWill
Copy link

This also broke ansible-podman-collections, see containers/ansible-podman-collections#712 .

AdamWill added a commit to AdamWill/ansible-podman-collections that referenced this pull request Feb 16, 2024
Podman 5 changed the output of `podman pod info` (when run on a
single pod) from being a dict to being a list of dicts:

containers/podman#21514

this should handle both ways. Unfortunately not sure how to add
a test for this as I can't see a unit test that mocks the output
of the command, only the integration test that gets real live
output, and I'm not sure how to get that test run with Podman 5.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
AdamWill added a commit to AdamWill/ansible-podman-collections that referenced this pull request Feb 16, 2024
Fixes containers#712

Podman 5 changed the output of `podman pod info` (when run on a
single pod) from being a dict to being a list of dicts:

containers/podman#21514

this should handle both ways. Unfortunately not sure how to add
a test for this as I can't see a unit test that mocks the output
of the command, only the integration test that gets real live
output, and I'm not sure how to get that test run with Podman 5.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
sshnaidm pushed a commit to containers/ansible-podman-collections that referenced this pull request Feb 17, 2024
Fixes #712

Podman 5 changed the output of `podman pod info` (when run on a
single pod) from being a dict to being a list of dicts:

containers/podman#21514

this should handle both ways. Unfortunately not sure how to add
a test for this as I can't see a unit test that mocks the output
of the command, only the integration test that gets real live
output, and I'm not sure how to get that test run with Podman 5.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
sshnaidm added a commit to sshnaidm/ansible-podman-collections that referenced this pull request Feb 17, 2024
Fix breakig change introduced in Podman v5:
 containers/podman#21514
Related-to: containers#712

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
sshnaidm added a commit to containers/ansible-podman-collections that referenced this pull request Feb 17, 2024
Fix breakig change introduced in Podman v5:
 containers/podman#21514
Related-to: #712

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
sshnaidm added a commit to sshnaidm/ansible-podman-collections that referenced this pull request Feb 18, 2024
Fixing issue from:
containers/podman#21514
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
sshnaidm added a commit to containers/ansible-podman-collections that referenced this pull request Feb 18, 2024
Fixing issue from:
containers/podman#21514
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label May 17, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
5.0 approved Indicates a PR has been approved by an approver from all required OWNERS files. breaking-change A change that will require a full version bump, i.e. 3.* to 4.* 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. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants