12 Commits

Author SHA1 Message Date
522934d5cf Replace strings.SplitN with strings.Cut
Cut is a cleaner & more performant api relative to SplitN(_, _, 2) added in go 1.18

Previously applied this refactoring to buildah:
https://github.com/containers/buildah/pull/5239

Signed-off-by: Philip Dubé <philip@peerdb.io>
2024-01-11 13:50:15 +00:00
8a90765b90 filters: use new FilterID function from c/common
Remove code duplication and use the new FilterID function from
c/common. Also remove the duplicated ComputeUntilTimestamp in podman use
the one from c/common as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-13 17:49:41 +02:00
4724a0000d prune filter handling
network and container prune could not handle the label!=... filter. vendor in c/common to fix this and
add some podman level handling to make everything run smoothly

resolves #14182

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-07-25 09:28:26 -04:00
a46f798831 pkg: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-08 08:54:47 +02:00
bd09b7aa79 bump go module to version 4
Automated for .go files via gomove [1]:
`gomove github.com/containers/podman/v3 github.com/containers/podman/v4`

Remaining files via vgrep [2]:
`vgrep github.com/containers/podman/v3`

[1] https://github.com/KSubedi/gomove
[2] https://github.com/vrothberg/vgrep

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2022-01-18 12:47:07 +01:00
6011149cae filter: use filepath.Match to maintain consistency with other pattern
matching in podman

Following commit ensures that we maintain consistency with how pattern
matching is being carried out everywhere else in podman.

Switch from `regexp` to `filepath.Match`

For example https://github.com/containers/common/blob/main/libimage/filters.go#L162

[NO NEW TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-11-19 22:07:47 +05:30
c050f05ccf filter: add basic pattern matching for label keys
Following PR adds basic pattern matching to filter by labels for `keys`.
Adds support for use-cases like `--filter label=some.prefix.com/key/*`
where end-users want to match a pattern for keys as compared to exact
value.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-11-15 17:49:54 +05:30
9c8277247d Fixes from make codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-21 13:16:33 -04:00
914218c1e8 Unification of until filter across list/prune endpoints
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-24 00:56:00 +01:00
5eab1b0742 Unification of label filter across list/prune endpoints
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-24 00:40:30 +01:00
aa2d6e6e6c Fix volumes and networks list/prune filters in http api
This is the continuation work started in #9711. It turns out
that list/prune commands for volumes in libpod/compat api have
very dangerous error handling when broken filter input is supplied.
Problem also affects network list/prune in libpod. This commit
unifies filter handling across libpod/compat api and adds sanity
apiv2 testcases.

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-19 00:09:29 +01:00
8ea02d0b60 network prune filters for http compat and libpod api
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-18 00:01:50 +01:00