From 41beb53744b308b6130575b4c2c46981ea5e1bbb Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 18 Sep 2023 14:06:51 +0200 Subject: [PATCH] --env-host: use default from containers.conf As found while working on #20000, the `--env-host` flag should use the default from containers.conf. Add a new "supported fields" test to the system tests to make sure we have a goto test for catching such regressions. I suspect more flags to not use the defaults from containers.conf. Signed-off-by: Valentin Rothberg --- cmd/podman/common/create.go | 4 +++- test/system/800-config.bats | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index c85de4d127..5c4d903c7e 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -140,7 +140,9 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, if !registry.IsRemote() { createFlags.BoolVar( &cf.EnvHost, - "env-host", false, "Use all current host environment variables in container", + "env-host", + podmanConfig.ContainersConfDefaultsRO.Containers.EnvHost, + "Use all current host environment variables in container", ) } diff --git a/test/system/800-config.bats b/test/system/800-config.bats index eef84e266a..11d107ef0a 100644 --- a/test/system/800-config.bats +++ b/test/system/800-config.bats @@ -177,4 +177,19 @@ EOF assert "${lines[1]}" = "$m2" "completion finds module 2" } +@test "podman --module - supported fields" { + skip_if_remote "--module is not supported for remote clients" + + conf_tmp="$PODMAN_TMPDIR/test.conf" + cat > $conf_tmp <