summaryrefslogtreecommitdiff
path: root/pkg/specgen/specgen.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-10-26 12:16:21 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-11-15 15:10:12 -0500
commit44d1618dd7eeb2560571b14ba5cece69a93dcaff (patch)
treefc84a330a86dcabb48f8d27754ffd679558364cb /pkg/specgen/specgen.go
parent230f0b622e391b78626f150471fce5c198048ed8 (diff)
downloadpodman-44d1618dd7eeb2560571b14ba5cece69a93dcaff.tar.gz
podman-44d1618dd7eeb2560571b14ba5cece69a93dcaff.tar.bz2
podman-44d1618dd7eeb2560571b14ba5cece69a93dcaff.zip
Add --unsetenv & --unsetenv-all to remove def environment variables
Podman adds a few environment variables by default, and currently there is no way to get rid of them from your container. This option will allow you to specify which defaults you don't want. --unsetenv-all will remove all default environment variables. Default environment variables can come from podman builtin, containers.conf or from the container image. Fixes: https://github.com/containers/podman/issues/11836 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgen/specgen.go')
-rw-r--r--pkg/specgen/specgen.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go
index d777287d7..cde456ad0 100644
--- a/pkg/specgen/specgen.go
+++ b/pkg/specgen/specgen.go
@@ -194,6 +194,13 @@ type ContainerBasicConfig struct {
// The execution domain system allows Linux to provide limited support
// for binaries compiled under other UNIX-like operating systems.
Personality *spec.LinuxPersonality `json:"personality,omitempty"`
+ // UnsetEnv unsets the specified default environment variables from the image or from buildin or containers.conf
+ // Optional.
+ UnsetEnv []string `json:"unsetenv,omitempty"`
+ // UnsetEnvAll unsetall default environment variables from the image or from buildin or containers.conf
+ // UnsetEnvAll unsets all default environment variables from the image or from buildin
+ // Optional.
+ UnsetEnvAll bool `json:"unsetenvall,omitempty"`
}
// ContainerStorageConfig contains information on the storage configuration of a