From 6fb0a706af438778dd372d4b05b417fb30a45965 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 15 Apr 2019 09:53:38 -0500 Subject: Fix segfaults attribute to missing options In cases where the remote client culls options to a command, we need to be sure that the lookup for that flag does not result in a nil pointer. To do so, we add a Remote attribute to the podman struct and then cli helper funcs are now aware they are remote. Signed-off-by: baude --- cmd/podman/exists.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/podman/exists.go') diff --git a/cmd/podman/exists.go b/cmd/podman/exists.go index 8a2f78c88..dae48f14b 100644 --- a/cmd/podman/exists.go +++ b/cmd/podman/exists.go @@ -29,6 +29,7 @@ var ( RunE: func(cmd *cobra.Command, args []string) error { imageExistsCommand.InputArgs = args imageExistsCommand.GlobalFlags = MainGlobalOpts + imageExistsCommand.Remote = remoteclient return imageExistsCmd(&imageExistsCommand) }, Example: `podman image exists imageID @@ -42,6 +43,7 @@ var ( RunE: func(cmd *cobra.Command, args []string) error { containerExistsCommand.InputArgs = args containerExistsCommand.GlobalFlags = MainGlobalOpts + containerExistsCommand.Remote = remoteclient return containerExistsCmd(&containerExistsCommand) }, @@ -56,6 +58,7 @@ var ( RunE: func(cmd *cobra.Command, args []string) error { podExistsCommand.InputArgs = args podExistsCommand.GlobalFlags = MainGlobalOpts + podExistsCommand.Remote = remoteclient return podExistsCmd(&podExistsCommand) }, Example: `podman pod exists podID -- cgit v1.2.3-54-g00ecf