Unification of until filter across list/prune endpoints

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
This commit is contained in:
Jakub Guzik
2021-03-24 00:42:42 +01:00
parent 5eab1b0742
commit 914218c1e8
5 changed files with 42 additions and 13 deletions

View File

@ -12,10 +12,10 @@ import (
)
// ComputeUntilTimestamp extracts until timestamp from filters
func ComputeUntilTimestamp(filter string, filterValues []string) (time.Time, error) {
func ComputeUntilTimestamp(filterValues []string) (time.Time, error) {
invalid := time.Time{}
if len(filterValues) != 1 {
return invalid, errors.Errorf("specify exactly one timestamp for %s", filter)
return invalid, errors.Errorf("specify exactly one timestamp for until")
}
ts, err := timetype.GetTimestamp(filterValues[0], time.Now())
if err != nil {