summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-10-03 12:44:39 +0200
committerGitHub <noreply@github.com>2022-10-03 12:44:39 +0200
commit5da3e1187e7c250584dc3002938be61e655e1a7b (patch)
tree3f1a3678505ffa4a75e083790368dc7d39d96f48 /cmd
parent84aff621f562fd90b8d5302ab7052d28f51ded0a (diff)
parent6f821f03d9e3f7a2e361177d2b301b16b2ea4866 (diff)
downloadpodman-5da3e1187e7c250584dc3002938be61e655e1a7b.tar.gz
podman-5da3e1187e7c250584dc3002938be61e655e1a7b.tar.bz2
podman-5da3e1187e7c250584dc3002938be61e655e1a7b.zip
Merge pull request #15846 from jakecorrenti/pod-logs-latest
`podman pod logs -l` no longer panics
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/pods/logs.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/podman/pods/logs.go b/cmd/podman/pods/logs.go
index 7093a7fa8..a0ec16976 100644
--- a/cmd/podman/pods/logs.go
+++ b/cmd/podman/pods/logs.go
@@ -121,5 +121,10 @@ func logs(_ *cobra.Command, args []string) error {
logsPodOptions.StdoutWriter = os.Stdout
logsPodOptions.StderrWriter = os.Stderr
- return registry.ContainerEngine().PodLogs(registry.GetContext(), args[0], logsPodOptions.PodLogsOptions)
+
+ podName := ""
+ if len(args) > 0 {
+ podName = args[0]
+ }
+ return registry.ContainerEngine().PodLogs(registry.GetContext(), podName, logsPodOptions.PodLogsOptions)
}