summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-10 18:53:08 +0100
committerGitHub <noreply@github.com>2022-01-10 18:53:08 +0100
commit8af574fdaa7b4ea546146c1a38d989bb4ef12b95 (patch)
tree11afa1f2936f83dea0a213c5c594dd6ff08d3f32 /pkg/specgen/generate
parenta957e8c5e237ec1af2eca991bff4d5de31155389 (diff)
parent4dc5a5b15db4884101fc85a543ca356f3346ef6a (diff)
downloadpodman-8af574fdaa7b4ea546146c1a38d989bb4ef12b95.tar.gz
podman-8af574fdaa7b4ea546146c1a38d989bb4ef12b95.tar.bz2
podman-8af574fdaa7b4ea546146c1a38d989bb4ef12b95.zip
Merge pull request #12757 from umohnani8/cm
Don't add env if optional and not found
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/kube/kube.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go
index 6d9f598c9..b41ee8db0 100644
--- a/pkg/specgen/generate/kube/kube.go
+++ b/pkg/specgen/generate/kube/kube.go
@@ -291,7 +291,10 @@ func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGener
return nil, err
}
- envs[env.Name] = value
+ // Only set the env if the value is not ""
+ if value != "" {
+ envs[env.Name] = value
+ }
}
for _, envFrom := range opts.Container.EnvFrom {
cmEnvs, err := envVarsFrom(envFrom, opts)