From 11fc0e55401a21a88c90a2fa646f2624541711fe Mon Sep 17 00:00:00 2001 From: Aditya Rajan Date: Fri, 3 Sep 2021 11:54:56 +0530 Subject: kube: Add support for podman pod logs Following PR adds support for `kubectl` like `pod logs` to podman. Usage `podman pod logs --- pkg/domain/infra/tunnel/pods.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkg/domain/infra/tunnel') diff --git a/pkg/domain/infra/tunnel/pods.go b/pkg/domain/infra/tunnel/pods.go index 480adb88a..8139216b3 100644 --- a/pkg/domain/infra/tunnel/pods.go +++ b/pkg/domain/infra/tunnel/pods.go @@ -42,6 +42,16 @@ func (ic *ContainerEngine) PodKill(ctx context.Context, namesOrIds []string, opt return reports, nil } +func (ic *ContainerEngine) PodLogs(_ context.Context, nameOrIDs string, options entities.PodLogsOptions) error { + // PodLogsOptions are similar but contains few extra fields like ctrName + // So cast other values as is so we can re-use the code + containerLogsOpts := entities.PodLogsOptionsToContainerLogsOptions(options) + + // interface only accepts slice, keep everything consistent + name := []string{options.ContainerName} + return ic.ContainerLogs(nil, name, containerLogsOpts) +} + func (ic *ContainerEngine) PodPause(ctx context.Context, namesOrIds []string, options entities.PodPauseOptions) ([]*entities.PodPauseReport, error) { foundPods, err := getPodsByContext(ic.ClientCtx, options.All, namesOrIds) if err != nil { -- cgit v1.2.3-54-g00ecf