diff options
author | Jakub Guzik <jakubmguzik@gmail.com> | 2021-03-24 00:42:42 +0100 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-03-29 13:26:24 -0400 |
commit | a01b387e8251bef5fc73f3e8ac72cc5db9ecea9e (patch) | |
tree | f7d18146e18813181e2963b429a124f1d110867c /libpod/image/prune.go | |
parent | 183a68a817208821a9fc79a3c9c19202a63dfb44 (diff) | |
download | podman-a01b387e8251bef5fc73f3e8ac72cc5db9ecea9e.tar.gz podman-a01b387e8251bef5fc73f3e8ac72cc5db9ecea9e.tar.bz2 podman-a01b387e8251bef5fc73f3e8ac72cc5db9ecea9e.zip |
Unification of until filter across list/prune endpoints
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
Diffstat (limited to 'libpod/image/prune.go')
-rw-r--r-- | libpod/image/prune.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/libpod/image/prune.go b/libpod/image/prune.go index 1ef35ef83..12727901a 100644 --- a/libpod/image/prune.go +++ b/libpod/image/prune.go @@ -4,11 +4,9 @@ import ( "context" "strconv" "strings" - "time" "github.com/containers/podman/v3/libpod/events" "github.com/containers/podman/v3/pkg/domain/entities/reports" - "github.com/containers/podman/v3/pkg/timetype" "github.com/containers/podman/v3/pkg/util" "github.com/containers/storage" "github.com/pkg/errors" @@ -27,15 +25,10 @@ func generatePruneFilterFuncs(filter, filterValue string) (ImageFilter, error) { }, nil case "until": - ts, err := timetype.GetTimestamp(filterValue, time.Now()) + until, err := util.ComputeUntilTimestamp([]string{filterValue}) if err != nil { return nil, err } - seconds, nanoseconds, err := timetype.ParseTimestamps(ts, 0) - if err != nil { - return nil, err - } - until := time.Unix(seconds, nanoseconds) return func(i *Image) bool { if !until.IsZero() && i.Created().After((until)) { return true |