mirror of
https://github.com/containers/podman.git
synced 2025-12-07 22:32:46 +08:00
Merge pull request #3599 from QiWang19/ps-regexp
support podman ps filter regular expressions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user