summaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-07-06 14:53:56 -0400
committercdoern <cdoern@redhat.com>2021-07-22 10:56:56 -0400
commit0f708efd8be843e06dd8a0ac68101a875a82c90e (patch)
treea1869f32538963daa6c4702115a82174ccf4eb85 /pkg/domain/infra
parent4fb4614cf14a362c047b17612488fbdc0dc8e253 (diff)
downloadpodman-0f708efd8be843e06dd8a0ac68101a875a82c90e.tar.gz
podman-0f708efd8be843e06dd8a0ac68101a875a82c90e.tar.bz2
podman-0f708efd8be843e06dd8a0ac68101a875a82c90e.zip
Implemented --until flag for libpod's container logs
compat containers/logs was missing actual usage of until query param. This led me to implement the until param for libpod's container logs as well. Added e2e tests. Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/containers.go1
-rw-r--r--pkg/domain/infra/tunnel/containers.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 50751aa12..485ab944d 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -998,6 +998,7 @@ func (ic *ContainerEngine) ContainerLogs(ctx context.Context, containers []strin
Details: options.Details,
Follow: options.Follow,
Since: options.Since,
+ Until: options.Until,
Tail: options.Tail,
Timestamps: options.Timestamps,
UseName: options.Names,
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go
index c17d7b54f..d7e8a4e46 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -369,10 +369,11 @@ func (ic *ContainerEngine) ContainerCreate(ctx context.Context, s *specgen.SpecG
func (ic *ContainerEngine) ContainerLogs(_ context.Context, nameOrIDs []string, opts entities.ContainerLogsOptions) error {
since := opts.Since.Format(time.RFC3339)
+ until := opts.Until.Format(time.RFC3339)
tail := strconv.FormatInt(opts.Tail, 10)
stdout := opts.StdoutWriter != nil
stderr := opts.StderrWriter != nil
- options := new(containers.LogOptions).WithFollow(opts.Follow).WithSince(since).WithStderr(stderr)
+ options := new(containers.LogOptions).WithFollow(opts.Follow).WithSince(since).WithUntil(until).WithStderr(stderr)
options.WithStdout(stdout).WithTail(tail)
var err error