Merge pull request #3599 from QiWang19/ps-regexp

support podman ps filter regular expressions
This commit is contained in:
OpenShift Merge Robot
2019-07-19 03:27:28 +02:00
committed by GitHub
2 changed files with 31 additions and 1 deletions

View File

@@ -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)