diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/containers/attach.go | 4 | ||||
-rw-r--r-- | cmd/podman/containers/checkpoint.go | 2 | ||||
-rw-r--r-- | cmd/podman/containers/rm.go | 9 | ||||
-rw-r--r-- | cmd/podman/containers/run.go | 4 | ||||
-rw-r--r-- | cmd/podman/containers/start.go | 4 | ||||
-rw-r--r-- | cmd/podman/system/events.go | 4 |
6 files changed, 17 insertions, 10 deletions
diff --git a/cmd/podman/containers/attach.go b/cmd/podman/containers/attach.go index 119b47d3f..9f29d1664 100644 --- a/cmd/podman/containers/attach.go +++ b/cmd/podman/containers/attach.go @@ -52,14 +52,14 @@ func attachFlags(flags *pflag.FlagSet) { func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: attachCommand, }) flags := attachCommand.Flags() attachFlags(flags) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: containerAttachCommand, Parent: containerCmd, }) diff --git a/cmd/podman/containers/checkpoint.go b/cmd/podman/containers/checkpoint.go index 7259ed38b..c4723af21 100644 --- a/cmd/podman/containers/checkpoint.go +++ b/cmd/podman/containers/checkpoint.go @@ -45,7 +45,7 @@ func init() { }) flags := checkpointCommand.Flags() flags.BoolVarP(&checkpointOptions.Keep, "keep", "k", false, "Keep all temporary checkpoint files") - flags.BoolVarP(&checkpointOptions.LeaveRuninng, "leave-running", "R", false, "Leave the container running after writing checkpoint to disk") + flags.BoolVarP(&checkpointOptions.LeaveRunning, "leave-running", "R", false, "Leave the container running after writing checkpoint to disk") flags.BoolVar(&checkpointOptions.TCPEstablished, "tcp-established", false, "Checkpoint a container with established TCP connections") flags.BoolVarP(&checkpointOptions.All, "all", "a", false, "Checkpoint all running containers") flags.BoolVarP(&checkpointOptions.Latest, "latest", "l", false, "Act on the latest container podman is aware of") diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go index 2a0f9cc6a..5ef2e23be 100644 --- a/cmd/podman/containers/rm.go +++ b/cmd/podman/containers/rm.go @@ -3,6 +3,7 @@ package containers import ( "context" "fmt" + "strings" "github.com/containers/libpod/cmd/podman/parse" "github.com/containers/libpod/cmd/podman/registry" @@ -120,10 +121,12 @@ func rm(cmd *cobra.Command, args []string) error { func setExitCode(err error) { cause := errors.Cause(err) - switch cause { - case define.ErrNoSuchCtr: + switch { + case cause == define.ErrNoSuchCtr: registry.SetExitCode(1) - case define.ErrCtrStateInvalid: + case strings.Contains(cause.Error(), define.ErrNoSuchImage.Error()): + registry.SetExitCode(1) + case cause == define.ErrCtrStateInvalid: registry.SetExitCode(2) } } diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go index 5f3ea9ef4..2298691a9 100644 --- a/cmd/podman/containers/run.go +++ b/cmd/podman/containers/run.go @@ -66,14 +66,14 @@ func runFlags(flags *pflag.FlagSet) { } func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: runCommand, }) flags := runCommand.Flags() runFlags(flags) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: containerRunCommand, Parent: containerCmd, }) diff --git a/cmd/podman/containers/start.go b/cmd/podman/containers/start.go index ce78d24ed..751fec65f 100644 --- a/cmd/podman/containers/start.go +++ b/cmd/podman/containers/start.go @@ -53,14 +53,14 @@ func startFlags(flags *pflag.FlagSet) { } func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: startCommand, }) flags := startCommand.Flags() startFlags(flags) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: containerStartCommand, Parent: containerCmd, }) diff --git a/cmd/podman/system/events.go b/cmd/podman/system/events.go index 6aae62dc0..27e80138e 100644 --- a/cmd/podman/system/events.go +++ b/cmd/podman/system/events.go @@ -5,6 +5,7 @@ import ( "context" "html/template" "os" + "strings" "github.com/containers/buildah/pkg/formats" "github.com/containers/libpod/cmd/podman/registry" @@ -54,6 +55,9 @@ func eventsCmd(cmd *cobra.Command, args []string) error { eventsError error tmpl *template.Template ) + if strings.Join(strings.Fields(eventFormat), "") == "{{json.}}" { + eventFormat = formats.JSONString + } if eventFormat != formats.JSONString { tmpl, err = template.New("events").Parse(eventFormat) if err != nil { |