mirror of
https://github.com/containers/podman.git
synced 2025-10-25 10:16:43 +08:00
podman-remote ps --external --pod --sort do not work.
Fixup the bindings and the handling of the --external --por and --sort flags. The --storage option was renamed --external, make sure we use external up and down the stack. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -78,7 +78,7 @@ func listFlagSet(cmd *cobra.Command) {
|
||||
flags := cmd.Flags()
|
||||
|
||||
flags.BoolVarP(&listOpts.All, "all", "a", false, "Show all the containers, default is only running containers")
|
||||
flags.BoolVar(&listOpts.Storage, "external", false, "Show containers in storage not controlled by Podman")
|
||||
flags.BoolVar(&listOpts.External, "external", false, "Show containers in storage not controlled by Podman")
|
||||
|
||||
filterFlagName := "filter"
|
||||
flags.StringSliceVarP(&filters, filterFlagName, "f", []string{}, "Filter output based on conditions given")
|
||||
@ -132,10 +132,10 @@ func checkFlags(c *cobra.Command) error {
|
||||
}
|
||||
cfg := registry.PodmanConfig()
|
||||
if cfg.Engine.Namespace != "" {
|
||||
if c.Flag("storage").Changed && listOpts.Storage {
|
||||
return errors.New("--namespace and --storage flags can not both be set")
|
||||
if c.Flag("storage").Changed && listOpts.External {
|
||||
return errors.New("--namespace and --external flags can not both be set")
|
||||
}
|
||||
listOpts.Storage = false
|
||||
listOpts.External = false
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@ -140,6 +140,10 @@ func removeContainers(namesOrIDs []string, rmOptions entities.RmOptions, setExit
|
||||
}
|
||||
|
||||
func setExitCode(err error) {
|
||||
// If error is set to no such container, do not reset
|
||||
if registry.GetExitCode() == 1 {
|
||||
return
|
||||
}
|
||||
cause := errors.Cause(err)
|
||||
switch {
|
||||
case cause == define.ErrNoSuchCtr:
|
||||
|
||||
Reference in New Issue
Block a user