-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
adding regex support to the ancestor ps filter function #16191
adding regex support to the ancestor ps filter function #16191
Conversation
455ff1d
to
0c6472a
Compare
pkg/domain/filters/containers.go
Outdated
@@ -96,8 +96,8 @@ func GenerateContainerFilterFuncs(filter string, filterValues []string, r *libpo | |||
} | |||
|
|||
if (rootfsImageID == filterValue) || | |||
(rootfsImageName == filterValue) || | |||
(imageNameWithoutTag == filterValue && imageTag == "latest") { | |||
util.StringMatchRegexSlice(rootfsImageName, filterValues) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace here is a little weird, please gofmt the file
@edsantiago PTAL at the test |
test/test_podman_baseline.sh
Outdated
@@ -81,6 +81,30 @@ echo $image | |||
######## | |||
podman run --rm $image ls -alF /etc | |||
|
|||
######## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a NOP. This "baseline" file, whatever it is, is not run or used anywhere. (I'll look into getting rid of it). Tests exist in test/system
and test/e2e
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this change and added a coupe of tests to test/e2e/ps_test.go
0c6472a
to
f59a9c2
Compare
Signed-off-by: Leonardo Rossetti <[email protected]>
f59a9c2
to
6c7ae37
Compare
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon, odra, 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 |
Closes #16180
This PR adds regular expression support the ancestor ps filter by uisng
util.StringMatchRegexSlice
instead of comparing the exact string value.The same function is used by the
name
filter.Does this PR introduce a user-facing change?
Yes, it adds regular expression support when using the ancestor ps filter, examples: