-
Notifications
You must be signed in to change notification settings - Fork 202
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
move prune filter parsing to common #1088
Conversation
libimage/filters.go
Outdated
filter = filterLabel(ctx, value) | ||
|
||
filter = filterLabel(ctx, value, false) | ||
case "label!": |
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.
Can you extend the tests in fitlers_test.go?
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.
@vrothberg, there are already tests in libimage/filters_test.go using label!
I have no idea how they were passing though....
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.
Looking at line 101
I don't think this is the right thing to do here. Can you investigate?
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.
@vrothberg oh i see, I think the issue is that when split, negate is correctly set to true, but we still go through the switch where the default is to error out. I am going to remove that whole negate block since it does not really do anything.
edit: actually I think this works. The issue must just be with libnetwork. Shouldn't these all share helper functions since the code is virtually the same?
there was some eerily similar code in c/common and in podman for creating filter functions for various types. Move some of it here and add support for the label!= filter in libnetwork only. Libimage already supports it. after this merges, will file a PR with the fix for containers within podman as well see containers/podman#14182 Signed-off-by: Charlie Doern <[email protected]>
ok @vrothberg @rhatdan @Luap99 I narrowed it down to just a libnetwork issue. which makes sense since, adding some debugs in podman's system prune shows that libimage parses the label! correctly and it fails on libnetwork. libnetwork and podman's |
LGTM |
/approve |
[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 |
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.
/lgtm
there was some eerily similar code in c/common and in podman for
creating filter functions for various types. Move some of it here
and add support for the label!= filter in libimage and libnetwork that basically creates the inverse
function of label=
after this merges, will file a PR with the fix for containers within podman as well
there is already a label!= test in libimage/filters_test. Libimage somehow lets this syntax slide
even though it does not actually imact anything in podman
see containers/podman#14182
Signed-off-by: Charlie Doern [email protected]