summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJake Correnti <jcorrenti13@gmail.com>2022-09-14 19:08:05 -0400
committerJake Correnti <jcorrenti13@gmail.com>2022-09-29 08:56:02 -0400
commit6f821f03d9e3f7a2e361177d2b301b16b2ea4866 (patch)
treea7be37e7ee131b865bd5204d06dc5377b1ce7ed1 /cmd
parent4e14fa05c9e6ce2ad927e953057294ae05748b37 (diff)
downloadpodman-6f821f03d9e3f7a2e361177d2b301b16b2ea4866.tar.gz
podman-6f821f03d9e3f7a2e361177d2b301b16b2ea4866.tar.bz2
podman-6f821f03d9e3f7a2e361177d2b301b16b2ea4866.zip
`podman pod logs -l` no longer panics
Fixed issue where executing the command `podman pod logs -l` would panic because it was indexing into an empty arguments array. Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
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)
}