summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.golangci.yml1
-rw-r--r--cmd/podmanV2/containers/kill.go9
-rw-r--r--cmd/podmanV2/containers/pause.go9
-rw-r--r--cmd/podmanV2/containers/restart.go9
-rw-r--r--cmd/podmanV2/containers/rm.go9
-rw-r--r--cmd/podmanV2/containers/stop.go9
-rw-r--r--cmd/podmanV2/containers/unpause.go9
-rw-r--r--cmd/podmanV2/containers/wait.go9
-rw-r--r--libpod/container_exec.go10
-rw-r--r--libpod/oci_conmon_linux.go1
-rw-r--r--pkg/domain/infra/abi/pods.go2
-rw-r--r--pkg/domain/infra/abi/volumes.go4
12 files changed, 45 insertions, 36 deletions
diff --git a/.golangci.yml b/.golangci.yml
index 8b1062b4c..8af8aea91 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -4,6 +4,7 @@ run:
- apparmor
- seccomp
- selinux
+ - ABISupport
concurrency: 6
deadline: 5m
skip-dirs-use-default: true
diff --git a/cmd/podmanV2/containers/kill.go b/cmd/podmanV2/containers/kill.go
index 36c4f2528..6e6debfec 100644
--- a/cmd/podmanV2/containers/kill.go
+++ b/cmd/podmanV2/containers/kill.go
@@ -15,10 +15,11 @@ import (
var (
killDescription = "The main process inside each container specified will be sent SIGKILL, or any signal specified with option --signal."
killCommand = &cobra.Command{
- Use: "kill [flags] CONTAINER [CONTAINER...]",
- Short: "Kill one or more running containers with a specific signal",
- Long: killDescription,
- RunE: kill,
+ Use: "kill [flags] CONTAINER [CONTAINER...]",
+ Short: "Kill one or more running containers with a specific signal",
+ Long: killDescription,
+ RunE: kill,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},
diff --git a/cmd/podmanV2/containers/pause.go b/cmd/podmanV2/containers/pause.go
index 99ca34d5c..a9b91b68f 100644
--- a/cmd/podmanV2/containers/pause.go
+++ b/cmd/podmanV2/containers/pause.go
@@ -15,10 +15,11 @@ import (
var (
pauseDescription = `Pauses one or more running containers. The container name or ID can be used.`
pauseCommand = &cobra.Command{
- Use: "pause [flags] CONTAINER [CONTAINER...]",
- Short: "Pause all the processes in one or more containers",
- Long: pauseDescription,
- RunE: pause,
+ Use: "pause [flags] CONTAINER [CONTAINER...]",
+ Short: "Pause all the processes in one or more containers",
+ Long: pauseDescription,
+ RunE: pause,
+ PersistentPreRunE: preRunE,
Example: `podman pause mywebserver
podman pause 860a4b23
podman pause -a`,
diff --git a/cmd/podmanV2/containers/restart.go b/cmd/podmanV2/containers/restart.go
index 216824389..053891f79 100644
--- a/cmd/podmanV2/containers/restart.go
+++ b/cmd/podmanV2/containers/restart.go
@@ -18,10 +18,11 @@ var (
A timeout before forcibly stopping can be set, but defaults to 10 seconds.`
restartCommand = &cobra.Command{
- Use: "restart [flags] CONTAINER [CONTAINER...]",
- Short: "Restart one or more containers",
- Long: restartDescription,
- RunE: restart,
+ Use: "restart [flags] CONTAINER [CONTAINER...]",
+ Short: "Restart one or more containers",
+ Long: restartDescription,
+ RunE: restart,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},
diff --git a/cmd/podmanV2/containers/rm.go b/cmd/podmanV2/containers/rm.go
index 916dd2577..75655e4cd 100644
--- a/cmd/podmanV2/containers/rm.go
+++ b/cmd/podmanV2/containers/rm.go
@@ -19,10 +19,11 @@ var (
Command does not remove images. Running or unusable containers will not be removed without the -f option.`
rmCommand = &cobra.Command{
- Use: "rm [flags] CONTAINER [CONTAINER...]",
- Short: "Remove one or more containers",
- Long: rmDescription,
- RunE: rm,
+ Use: "rm [flags] CONTAINER [CONTAINER...]",
+ Short: "Remove one or more containers",
+ Long: rmDescription,
+ RunE: rm,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
},
diff --git a/cmd/podmanV2/containers/stop.go b/cmd/podmanV2/containers/stop.go
index b6d70784d..58d47fd52 100644
--- a/cmd/podmanV2/containers/stop.go
+++ b/cmd/podmanV2/containers/stop.go
@@ -18,10 +18,11 @@ var (
A timeout to forcibly stop the container can also be set but defaults to 10 seconds otherwise.`
stopCommand = &cobra.Command{
- Use: "stop [flags] CONTAINER [CONTAINER...]",
- Short: "Stop one or more containers",
- Long: stopDescription,
- RunE: stop,
+ Use: "stop [flags] CONTAINER [CONTAINER...]",
+ Short: "Stop one or more containers",
+ Long: stopDescription,
+ RunE: stop,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, true)
},
diff --git a/cmd/podmanV2/containers/unpause.go b/cmd/podmanV2/containers/unpause.go
index 8b8cde9b2..6a3179f10 100644
--- a/cmd/podmanV2/containers/unpause.go
+++ b/cmd/podmanV2/containers/unpause.go
@@ -15,10 +15,11 @@ import (
var (
unpauseDescription = `Unpauses one or more previously paused containers. The container name or ID can be used.`
unpauseCommand = &cobra.Command{
- Use: "unpause [flags] CONTAINER [CONTAINER...]",
- Short: "Unpause the processes in one or more containers",
- Long: unpauseDescription,
- RunE: unpause,
+ Use: "unpause [flags] CONTAINER [CONTAINER...]",
+ Short: "Unpause the processes in one or more containers",
+ Long: unpauseDescription,
+ RunE: unpause,
+ PersistentPreRunE: preRunE,
Example: `podman unpause ctrID
podman unpause --all`,
}
diff --git a/cmd/podmanV2/containers/wait.go b/cmd/podmanV2/containers/wait.go
index 4367fd9d9..bf3c86200 100644
--- a/cmd/podmanV2/containers/wait.go
+++ b/cmd/podmanV2/containers/wait.go
@@ -18,10 +18,11 @@ var (
waitDescription = `Block until one or more containers stop and then print their exit codes.
`
waitCommand = &cobra.Command{
- Use: "wait [flags] CONTAINER [CONTAINER...]",
- Short: "Block on one or more containers",
- Long: waitDescription,
- RunE: wait,
+ Use: "wait [flags] CONTAINER [CONTAINER...]",
+ Short: "Block on one or more containers",
+ Long: waitDescription,
+ RunE: wait,
+ PersistentPreRunE: preRunE,
Args: func(cmd *cobra.Command, args []string) error {
return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
},
diff --git a/libpod/container_exec.go b/libpod/container_exec.go
index 7ed7a3343..6b88e5205 100644
--- a/libpod/container_exec.go
+++ b/libpod/container_exec.go
@@ -575,7 +575,7 @@ func (c *Container) ExecResize(sessionID string, newSize remotecommand.TerminalS
return errors.Wrapf(define.ErrNoSuchExecSession, "container %s has no exec session with ID %s", c.ID(), sessionID)
}
- logrus.Infof("Removing container %s exec session %s", c.ID(), session.ID())
+ logrus.Infof("Resizing container %s exec session %s to %+v", c.ID(), session.ID(), newSize)
if session.State != define.ExecStateRunning {
return errors.Wrapf(define.ErrExecSessionStateInvalid, "cannot resize container %s exec session %s as it is not running", c.ID(), session.ID())
@@ -592,9 +592,6 @@ func (c *Container) Exec(config *ExecConfig, streams *AttachStreams, resize <-ch
if err != nil {
return -1, err
}
- if err := c.ExecStartAndAttach(sessionID, streams); err != nil {
- return -1, err
- }
// Start resizing if we have a resize channel.
// This goroutine may likely leak, given that we cannot close it here.
@@ -605,6 +602,7 @@ func (c *Container) Exec(config *ExecConfig, streams *AttachStreams, resize <-ch
// session.
if resize != nil {
go func() {
+ logrus.Debugf("Sending resize events to exec session %s", sessionID)
for resizeRequest := range resize {
if err := c.ExecResize(sessionID, resizeRequest); err != nil {
// Assume the exec session went down.
@@ -615,6 +613,10 @@ func (c *Container) Exec(config *ExecConfig, streams *AttachStreams, resize <-ch
}()
}
+ if err := c.ExecStartAndAttach(sessionID, streams); err != nil {
+ return -1, err
+ }
+
session, err := c.ExecSession(sessionID)
if err != nil {
return -1, err
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 82c5d7020..6d9a976cb 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -793,7 +793,6 @@ func (r *ConmonOCIRuntime) ExecAttachResize(ctr *Container, sessionID string, ne
}
defer controlFile.Close()
- logrus.Debugf("Received a resize event for container %s exec session %s: %+v", ctr.ID(), sessionID, newSize)
if _, err = fmt.Fprintf(controlFile, "%d %d %d\n", 1, newSize.Height, newSize.Width); err != nil {
return errors.Wrapf(err, "failed to write to ctl file to resize terminal")
}
diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go
index de22de68e..8dd7b5a0c 100644
--- a/pkg/domain/infra/abi/pods.go
+++ b/pkg/domain/infra/abi/pods.go
@@ -4,10 +4,10 @@ package abi
import (
"context"
- "github.com/pkg/errors"
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/pkg/domain/entities"
+ "github.com/pkg/errors"
)
func (ic *ContainerEngine) PodExists(ctx context.Context, nameOrId string) (*entities.BoolReport, error) {
diff --git a/pkg/domain/infra/abi/volumes.go b/pkg/domain/infra/abi/volumes.go
index 0cc20474e..5527bb82e 100644
--- a/pkg/domain/infra/abi/volumes.go
+++ b/pkg/domain/infra/abi/volumes.go
@@ -107,7 +107,7 @@ func (ic *ContainerEngine) VolumeInspect(ctx context.Context, namesOrIds []strin
UID: v.UID(),
GID: v.GID(),
}
- reports = append(reports, &entities.VolumeInspectReport{&config})
+ reports = append(reports, &entities.VolumeInspectReport{VolumeConfigResponse: &config})
}
return reports, nil
}
@@ -140,7 +140,7 @@ func (ic *ContainerEngine) VolumeList(ctx context.Context, opts entities.VolumeL
UID: v.UID(),
GID: v.GID(),
}
- reports = append(reports, &entities.VolumeListReport{config})
+ reports = append(reports, &entities.VolumeListReport{VolumeConfigResponse: config})
}
return reports, nil
}