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

Return title fields as a list #18136

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Apr 10, 2023

Podman is attempting to split the headers returned by the ps
command into a list of headers. Problem is that some headers
are multi-word, and headers are not guaranteed to be split via
a tab. This PR splits the headers bases on white space, and for
the select group of CAPS headers which are multi-word, combines
them back together.

Fixes: #17524

Does this PR introduce a user-facing change?

Fix top Titles return in compatible API.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 10, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 Apr 10, 2023
@rhatdan rhatdan added 4.5 and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 10, 2023
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Apr 10, 2023
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2023
@vrothberg
Copy link
Member

Tests aren't happy. Let's not make this block 4.5.

@vrothberg vrothberg removed the 4.5 label Apr 11, 2023
@rhatdan rhatdan force-pushed the docker branch 2 times, most recently from e83409a to 8052e70 Compare April 12, 2023 20:27
Podman is attempting to split the headers returned by the ps
command into a list of headers. Problem is that some headers
are multi-word, and headers are not guaranteed to be split via
a tab. This PR splits the headers bases on white space, and for
the select group of CAPS headers which are multi-word, combines
them back together.

Fixes: containers#17524

Signed-off-by: Daniel J Walsh <[email protected]>
@mheon
Copy link
Member

mheon commented Apr 13, 2023

/cherry-pick v4.5

@openshift-cherrypick-robot
Copy link
Collaborator

@mheon: once the present PR merges, I will cherry-pick it on top of v4.5 in a new PR and assign it to you.

In response to this:

/cherry-pick v4.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mheon
Copy link
Member

mheon commented Apr 13, 2023

LGTM
@baude @Luap99 @vrothberg PTAL

@baude
Copy link
Member

baude commented Apr 13, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2023
@openshift-merge-robot openshift-merge-robot merged commit 2b78157 into containers:main Apr 13, 2023
@openshift-cherrypick-robot
Copy link
Collaborator

@mheon: new pull request created: #18191

In response to this:

/cherry-pick v4.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Comment on lines +248 to +258
for _, title := range strings.Fields(output) {
switch title {
case "AMBIENT", "INHERITED", "PERMITTED", "EFFECTIVE", "BOUNDING":
{
titles = append(titles, title+" CAPS")
}
case "CAPS":
continue
default:
titles = append(titles, title)
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we somehow expose this in psgo? This looks rather hacky and will break every-time psgo adds a new header with space. cc @vrothberg

Copy link
Member

Choose a reason for hiding this comment

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

This functionality doesn't look being tested. A flip in psgo wouldn't hurt.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are we guaranteed to go through psgo all the time, don't we sometimes still exec ps?

While a new "space" added filed could cause an issue, it would be only a bad formatting on screen, not an actual bug.

Moving this function to psgo makes sense or having psgo expose all of these fields so we could get the list from it would make sense.

@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 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 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. kind/api-change Change to remote API; merits scrutiny 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.

podman socket API top returns Titles as single string instead of array of strings
7 participants