From 2ea8cd1b4fc5778e0e0b9a83d86fca1f41e76235 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 12 Feb 2019 15:38:30 -0600 Subject: Only build varlink when buildtag is available Correct mistake that broke things like dlv where we should only try to add the varlink command to podman when the 'varlink' build tag is present. Signed-off-by: baude --- cmd/podman/commands.go | 5 ++++- cmd/podman/varlink_dummy.go | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/podman/commands.go b/cmd/podman/commands.go index 2c56d5dec..71eb35048 100644 --- a/cmd/podman/commands.go +++ b/cmd/podman/commands.go @@ -42,10 +42,13 @@ func getMainCommands() []*cobra.Command { _topCommand, _umountCommand, _unpauseCommand, - _varlinkCommand, volumeCommand.Command, _waitCommand, } + + if len(_varlinkCommand.Use) > 0 { + rootCommands = append(rootCommands, _varlinkCommand) + } return rootCommands } diff --git a/cmd/podman/varlink_dummy.go b/cmd/podman/varlink_dummy.go index 8d7a7e8ca..430511d72 100644 --- a/cmd/podman/varlink_dummy.go +++ b/cmd/podman/varlink_dummy.go @@ -2,8 +2,10 @@ package main -import ( - "github.com/containers/libpod/cmd/podman/cliconfig" -) +import "github.com/spf13/cobra" -var varlinkCommand *cliconfig.PodmanCommand +var ( + _varlinkCommand = &cobra.Command{ + Use: "", + } +) -- cgit v1.2.3-54-g00ecf