summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-07-06 14:53:56 -0400
committercdoern <cdoern@redhat.com>2021-07-09 12:21:46 -0400
commit4624142c2db039343efc8c9b8070cf1e0d3a7262 (patch)
treeca5af233eb2ed67036eeffa05f939743196fac38 /pkg/api
parent1a9cb93f16cf19e14581319e2fd1b60e791f74dd (diff)
downloadpodman-4624142c2db039343efc8c9b8070cf1e0d3a7262.tar.gz
podman-4624142c2db039343efc8c9b8070cf1e0d3a7262.tar.bz2
podman-4624142c2db039343efc8c9b8070cf1e0d3a7262.zip
Implemented Until Query Parameter for Containers/logs
compat containers/logs was missing actual usage of until query param. fixes #10859 Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/containers_logs.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkg/api/handlers/compat/containers_logs.go b/pkg/api/handlers/compat/containers_logs.go
index cb4dee4d2..656e2c627 100644
--- a/pkg/api/handlers/compat/containers_logs.go
+++ b/pkg/api/handlers/compat/containers_logs.go
@@ -72,11 +72,12 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
var until time.Time
if _, found := r.URL.Query()["until"]; found {
- // FIXME: until != since but the logs backend does not yet support until.
- since, err = util.ParseInputTime(query.Until)
- if err != nil {
- utils.BadRequest(w, "until", query.Until, err)
- return
+ if query.Until != "0" {
+ until, err = util.ParseInputTime(query.Until)
+ if err != nil {
+ utils.BadRequest(w, "until", query.Until, err)
+ return
+ }
}
}
@@ -84,6 +85,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
Details: true,
Follow: query.Follow,
Since: since,
+ Until: until,
Tail: tail,
Timestamps: query.Timestamps,
}
@@ -119,7 +121,7 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
for line := range logChannel {
if _, found := r.URL.Query()["until"]; found {
- if line.Time.After(until) {
+ if line.Time.After(until) && !until.IsZero() {
break
}
}