diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-23 21:29:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 21:29:25 +0100 |
commit | 3d21da3d11dc9b5944912544609c302c86e56b97 (patch) | |
tree | 339f4b51ae80e3dd592fa41edd55f2a2fae0a6ac /cmd | |
parent | bbc0deb8e8b131d901c2c9932add328258ccd341 (diff) | |
parent | c81e29525b0ea84107147d92283c2b88909d1f12 (diff) | |
download | podman-3d21da3d11dc9b5944912544609c302c86e56b97.tar.gz podman-3d21da3d11dc9b5944912544609c302c86e56b97.tar.bz2 podman-3d21da3d11dc9b5944912544609c302c86e56b97.zip |
Merge pull request #8820 from baude/issue8443
add --cidfile to container kill
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/containers/kill.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/podman/containers/kill.go b/cmd/podman/containers/kill.go index 4640229a9..28040e08a 100644 --- a/cmd/podman/containers/kill.go +++ b/cmd/podman/containers/kill.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" + "github.com/containers/common/pkg/completion" "github.com/containers/podman/v2/cmd/podman/common" "github.com/containers/podman/v2/cmd/podman/registry" "github.com/containers/podman/v2/cmd/podman/utils" @@ -22,7 +23,7 @@ var ( Long: killDescription, RunE: kill, Args: func(cmd *cobra.Command, args []string) error { - return validate.CheckAllLatestAndCIDFile(cmd, args, false, false) + return validate.CheckAllLatestAndCIDFile(cmd, args, false, true) }, ValidArgsFunction: common.AutocompleteContainersRunning, Example: `podman kill mywebserver @@ -32,7 +33,7 @@ var ( containerKillCommand = &cobra.Command{ Args: func(cmd *cobra.Command, args []string) error { - return validate.CheckAllLatestAndCIDFile(cmd, args, false, false) + return validate.CheckAllLatestAndCIDFile(cmd, args, false, true) }, Use: killCommand.Use, Short: killCommand.Short, @@ -57,6 +58,9 @@ func killFlags(cmd *cobra.Command) { signalFlagName := "signal" flags.StringVarP(&killOptions.Signal, signalFlagName, "s", "KILL", "Signal to send to the container") _ = cmd.RegisterFlagCompletionFunc(signalFlagName, common.AutocompleteStopSignal) + cidfileFlagName := "cidfile" + flags.StringArrayVar(&killOptions.CIDFiles, cidfileFlagName, []string{}, "Read the container ID from the file") + _ = cmd.RegisterFlagCompletionFunc(cidfileFlagName, completion.AutocompleteDefault) } func init() { |