summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorSebastian Jug <seb@stianj.ug>2021-05-21 10:39:19 -0400
committerSebastian Jug <seb@stianj.ug>2021-05-25 17:26:50 -0400
commit738a8fe637775e295af72cb55155a36fa366bfd7 (patch)
treefae5a513bd7c9bb92bc78b0b2395fb1c271d5071 /cmd/podman
parente48aa8c82f7f26260f6911bb3ea99ff54c294675 (diff)
downloadpodman-738a8fe637775e295af72cb55155a36fa366bfd7.tar.gz
podman-738a8fe637775e295af72cb55155a36fa366bfd7.tar.bz2
podman-738a8fe637775e295af72cb55155a36fa366bfd7.zip
Add podman run --gpus flag for compatibility
- Add log message for --gpus flag - Add test Signed-off-by: Sebastian Jug <seb@stianj.ug>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/run.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go
index 8e27977c0..4bd06a47b 100644
--- a/cmd/podman/containers/run.go
+++ b/cmd/podman/containers/run.go
@@ -77,6 +77,11 @@ func runFlags(cmd *cobra.Command) {
flags.StringVar(&runOpts.DetachKeys, detachKeysFlagName, containerConfig.DetachKeys(), "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or a comma separated sequence of `ctrl-<value>`, where `<value>` is one of: `a-cf`, `@`, `^`, `[`, `\\`, `]`, `^` or `_`")
_ = cmd.RegisterFlagCompletionFunc(detachKeysFlagName, common.AutocompleteDetachKeys)
+ gpuFlagName := "gpus"
+ flags.String(gpuFlagName, "", "This is a Docker specific option and is a NOOP")
+ _ = cmd.RegisterFlagCompletionFunc(gpuFlagName, completion.AutocompleteNone)
+ _ = flags.MarkHidden("gpus")
+
if registry.IsRemote() {
_ = flags.MarkHidden("preserve-fds")
_ = flags.MarkHidden("conmon-pidfile")
@@ -204,5 +209,8 @@ func run(cmd *cobra.Command, args []string) error {
logrus.Errorf("%s", errorhandling.JoinErrors(rmErrors))
}
}
+ if cmd.Flag("gpus").Changed {
+ logrus.Info("--gpus is a Docker specific option and is a NOOP")
+ }
return nil
}