diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-24 15:38:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 15:38:46 -0500 |
commit | 4988e39c645c5c520fdc9094fdb1bd4a45a852a0 (patch) | |
tree | 8c9f6b6136137f9f8d19b83c240b2b18675b73f4 | |
parent | 667dfb4ac3ca4b7d7726240db04de4d4b10f8bbd (diff) | |
parent | 1cddd63976b8f266ab4d5088061b7b8cd0f3b412 (diff) | |
download | podman-4988e39c645c5c520fdc9094fdb1bd4a45a852a0.tar.gz podman-4988e39c645c5c520fdc9094fdb1bd4a45a852a0.tar.bz2 podman-4988e39c645c5c520fdc9094fdb1bd4a45a852a0.zip |
Merge pull request #12982 from rhatdan/default
Show correct default values or show none
-rw-r--r-- | cmd/podman/root.go | 4 | ||||
-rw-r--r-- | test/e2e/common_test.go | 8 | ||||
-rw-r--r-- | test/e2e/containers_conf_test.go | 17 |
3 files changed, 24 insertions, 5 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go index be6eacfc2..6d768c2e6 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -415,12 +415,12 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) { _ = cmd.RegisterFlagCompletionFunc(runrootFlagName, completion.AutocompleteDefault) runtimeFlagName := "runtime" - pFlags.StringVar(&opts.RuntimePath, runtimeFlagName, "", "Path to the OCI-compatible binary used to run containers, default is /usr/bin/runc") + pFlags.StringVar(&opts.RuntimePath, runtimeFlagName, cfg.Engine.OCIRuntime, "Path to the OCI-compatible binary used to run containers.") _ = cmd.RegisterFlagCompletionFunc(runtimeFlagName, completion.AutocompleteDefault) // -s is deprecated due to conflict with -s on subcommands storageDriverFlagName := "storage-driver" - pFlags.StringVar(&opts.StorageDriver, storageDriverFlagName, "", "Select which storage driver is used to manage storage of images and containers (default is overlay)") + pFlags.StringVar(&opts.StorageDriver, storageDriverFlagName, "", "Select which storage driver is used to manage storage of images and containers") _ = cmd.RegisterFlagCompletionFunc(storageDriverFlagName, completion.AutocompleteNone) //TODO: what can we recommend here? tmpdirFlagName := "tmpdir" diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 56f050665..796ae8141 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -719,6 +719,14 @@ func SkipIfRemote(reason string) { Skip("[remote]: " + reason) } +func SkipIfNotRemote(reason string) { + checkReason(reason) + if IsRemote() { + return + } + Skip("[local]: " + reason) +} + // SkipIfInContainer skips a test if the test is run inside a container func SkipIfInContainer(reason string) { checkReason(reason) diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go index 69eea580a..a23983623 100644 --- a/test/e2e/containers_conf_test.go +++ b/test/e2e/containers_conf_test.go @@ -304,9 +304,7 @@ var _ = Describe("Verify podman containers.conf usage", func() { }) It("podman-remote test localcontainers.conf", func() { - if !IsRemote() { - Skip("this test is only for remote") - } + SkipIfNotRemote("this test is only for remote") os.Setenv("CONTAINERS_CONF", "config/containers-remote.conf") // Configuration that comes from remote server @@ -560,4 +558,17 @@ var _ = Describe("Verify podman containers.conf usage", func() { inspect.WaitWithDefaultTimeout() Expect(inspect.OutputToString()).To(Equal("disabled")) }) + + It("podman containers.conf runtime", func() { + SkipIfRemote("--runtime option is not available for remote commands") + conffile := filepath.Join(podmanTest.TempDir, "container.conf") + err := ioutil.WriteFile(conffile, []byte("[engine]\nruntime=\"testruntime\"\n"), 0755) + Expect(err).ToNot(HaveOccurred()) + + os.Setenv("CONTAINERS_CONF", conffile) + result := podmanTest.Podman([]string{"--help"}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(0)) + Expect(result.OutputToString()).To(ContainSubstring("Path to the OCI-compatible binary used to run containers. (default \"testruntime\")")) + }) }) |