summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/wait.go9
-rw-r--r--cmd/podman/images/build.go9
-rw-r--r--cmd/podman/root.go2
3 files changed, 10 insertions, 10 deletions
diff --git a/cmd/podman/containers/wait.go b/cmd/podman/containers/wait.go
index 74ee6073a..9bb39e978 100644
--- a/cmd/podman/containers/wait.go
+++ b/cmd/podman/containers/wait.go
@@ -23,7 +23,6 @@ var (
Short: "Block on one or more containers",
Long: waitDescription,
RunE: wait,
- Args: validate.IDOrLatestArgs,
Example: `podman wait --interval 5000 ctrID
podman wait ctrID1 ctrID2`,
}
@@ -33,7 +32,6 @@ var (
Short: waitCommand.Short,
Long: waitCommand.Long,
RunE: waitCommand.RunE,
- Args: validate.IDOrLatestArgs,
Example: `podman container wait --interval 5000 ctrID
podman container wait ctrID1 ctrID2`,
}
@@ -76,6 +74,13 @@ func wait(cmd *cobra.Command, args []string) error {
return errors.New("interval must be greater then 0")
}
+ if !waitOptions.Latest && len(args) == 0 {
+ return errors.Errorf("%q requires a name, id, or the \"--latest\" flag", cmd.CommandPath())
+ }
+ if waitOptions.Latest && len(args) > 0 {
+ return errors.New("--latest and containers are not allowed")
+ }
+
waitOptions.Condition, err = define.StringToContainerStatus(waitCondition)
if err != nil {
return err
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index ff5c6ec09..00777c48c 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -206,14 +206,9 @@ func build(cmd *cobra.Command, args []string) error {
}
}
- ie, err := registry.NewImageEngine(cmd, args)
- if err != nil {
- return err
- }
-
var logfile *os.File
if cmd.Flag("logfile").Changed {
- logfile, err = os.OpenFile(buildOpts.Logfile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
+ logfile, err := os.OpenFile(buildOpts.Logfile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
if err != nil {
return errors.Errorf("error opening logfile %q: %v", buildOpts.Logfile, err)
}
@@ -225,7 +220,7 @@ func build(cmd *cobra.Command, args []string) error {
return err
}
- _, err = ie.Build(registry.GetContext(), containerFiles, *apiBuildOpts)
+ _, err = registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts)
return err
}
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 60725b111..d079018a0 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -273,7 +273,6 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) {
pFlags.StringVar(&opts.RegistriesConf, "registries-conf", "", "Path to a registries.conf to use for image processing")
pFlags.StringVar(&opts.Runroot, "runroot", "", "Path to the 'run directory' where all state information is stored")
pFlags.StringVar(&opts.RuntimePath, "runtime", "", "Path to the OCI-compatible binary used to run containers, default is /usr/bin/runc")
- pFlags.StringArrayVar(&opts.RuntimeFlags, "runtime-flag", []string{}, "add global flags for the container runtime")
// -s is deprecated due to conflict with -s on subcommands
pFlags.StringVar(&opts.StorageDriver, "storage-driver", "", "Select which storage driver is used to manage storage of images and containers (default is overlay)")
pFlags.StringArrayVar(&opts.StorageOpts, "storage-opt", []string{}, "Used to pass an option to the storage driver")
@@ -301,6 +300,7 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) {
// Only create these flags for ABI connections
if !registry.IsRemote() {
+ pFlags.StringArrayVar(&opts.RuntimeFlags, "runtime-flag", []string{}, "add global flags for the container runtime")
pFlags.BoolVar(&useSyslog, "syslog", false, "Output logging information to syslog as well as the console (default false)")
}
}