summaryrefslogtreecommitdiff
path: root/cmd/podman/pods/kill.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-29 11:31:39 -0400
committerGitHub <noreply@github.com>2020-06-29 11:31:39 -0400
commit59e6192eb6027ebf520a4b5ea4137d0a85f23c02 (patch)
treed4641b6c3f7d6a1c7d4fa64df3994578ca0630be /cmd/podman/pods/kill.go
parent6ac009d5304127f6758be157c7302646e5a481e5 (diff)
parent6fb5f01c736d5cbf11bc7eaad09f6f0c7fd1d0d4 (diff)
downloadpodman-59e6192eb6027ebf520a4b5ea4137d0a85f23c02.tar.gz
podman-59e6192eb6027ebf520a4b5ea4137d0a85f23c02.tar.bz2
podman-59e6192eb6027ebf520a4b5ea4137d0a85f23c02.zip
Merge pull request #6716 from jwhonce/issues/6598
Fixes --remote flag issues
Diffstat (limited to 'cmd/podman/pods/kill.go')
-rw-r--r--cmd/podman/pods/kill.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmd/podman/pods/kill.go b/cmd/podman/pods/kill.go
index 02089016e..d83e4d77e 100644
--- a/cmd/podman/pods/kill.go
+++ b/cmd/podman/pods/kill.go
@@ -4,9 +4,9 @@ import (
"context"
"fmt"
- "github.com/containers/libpod/cmd/podman/parse"
"github.com/containers/libpod/cmd/podman/registry"
"github.com/containers/libpod/cmd/podman/utils"
+ "github.com/containers/libpod/cmd/podman/validate"
"github.com/containers/libpod/pkg/domain/entities"
"github.com/spf13/cobra"
)
@@ -21,7 +21,7 @@ var (
Long: podKillDescription,
RunE: kill,
Args: func(cmd *cobra.Command, args []string) error {
- return parse.CheckAllLatestAndCIDFile(cmd, args, false, false)
+ return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
},
Example: `podman pod kill podID
podman pod kill --signal TERM mywebserver
@@ -41,14 +41,11 @@ func init() {
})
flags := killCommand.Flags()
flags.BoolVarP(&killOpts.All, "all", "a", false, "Kill all containers in all pods")
- flags.BoolVarP(&killOpts.Latest, "latest", "l", false, "Act on the latest pod podman is aware of")
flags.StringVarP(&killOpts.Signal, "signal", "s", "KILL", "Signal to send to the containers in the pod")
- if registry.IsRemote() {
- _ = flags.MarkHidden("latest")
- }
-
+ validate.AddLatestFlag(killCommand, &killOpts.Latest)
}
-func kill(cmd *cobra.Command, args []string) error {
+
+func kill(_ *cobra.Command, args []string) error {
var (
errs utils.OutputErrors
)