mirror of
https://github.com/containers/podman.git
synced 2025-06-05 05:57:24 +08:00
Support Unix timestamps for podman logs --since
To match what podman-logs(1) describes --since Signed-off-by: Chih-Hsuan Yen <yan12125@gmail.com>
This commit is contained in:
@ -530,6 +530,11 @@ func ParseInputTime(inputTime string) (time.Time, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unix_timestamp, err := strconv.ParseInt(inputTime, 10, 64)
|
||||||
|
if err == nil {
|
||||||
|
return time.Unix(unix_timestamp, 0), nil
|
||||||
|
}
|
||||||
|
|
||||||
// input might be a duration
|
// input might be a duration
|
||||||
duration, err := time.ParseDuration(inputTime)
|
duration, err := time.ParseDuration(inputTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -21,6 +21,9 @@ load helpers
|
|||||||
run_podman logs $cid
|
run_podman logs $cid
|
||||||
is "$output" "$rand_string" "output from podman-logs after container is run"
|
is "$output" "$rand_string" "output from podman-logs after container is run"
|
||||||
|
|
||||||
|
# test --since with Unix timestamps
|
||||||
|
run_podman logs --since 1000 $cid
|
||||||
|
|
||||||
run_podman rm $cid
|
run_podman rm $cid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user