diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-19 03:27:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-19 03:27:28 +0200 |
commit | 398aeac8537e82ca813bb77e44ddfcefa5cc5ad5 (patch) | |
tree | e102899dd712e697edba88e84c0041a014294fa0 /cmd/podman/shared/container.go | |
parent | deb087d7b173832138c2e46ab4b7b626a98a910c (diff) | |
parent | 5047c79e71a336da1fa2e0b8fc6e50811801f878 (diff) | |
download | podman-398aeac8537e82ca813bb77e44ddfcefa5cc5ad5.tar.gz podman-398aeac8537e82ca813bb77e44ddfcefa5cc5ad5.tar.bz2 podman-398aeac8537e82ca813bb77e44ddfcefa5cc5ad5.zip |
Merge pull request #3599 from QiWang19/ps-regexp
support podman ps filter regular expressions
Diffstat (limited to 'cmd/podman/shared/container.go')
-rw-r--r-- | cmd/podman/shared/container.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/shared/container.go b/cmd/podman/shared/container.go index 3c68a29b4..5492f843f 100644 --- a/cmd/podman/shared/container.go +++ b/cmd/podman/shared/container.go @@ -296,7 +296,11 @@ func generateContainerFilterFuncs(filter, filterValue string, r *libpod.Runtime) }, nil case "name": return func(c *libpod.Container) bool { - return strings.Contains(c.Name(), filterValue) + match, err := regexp.MatchString(filterValue, c.Name()) + if err != nil { + return false + } + return match }, nil case "exited": exitCode, err := strconv.ParseInt(filterValue, 10, 32) |