mirror of
https://github.com/containers/podman.git
synced 2025-06-21 17:38:12 +08:00
Merge pull request #8589 from yan12125/container-logs-unix-timestamps
Support Unix timestamps for `podman logs --since`
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