diff options
author | Peter Hunt <pehunt@redhat.com> | 2019-04-14 16:27:52 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2019-04-14 16:27:52 -0400 |
commit | e61838bc3b25faba708856e2208aa2026381a341 (patch) | |
tree | bf31d22dd96ecc0688b8dc5301f390dc9a77c456 /cmd/podman/play_kube.go | |
parent | 167ce59416f6e03f4477269e33e9e5cf5b700a86 (diff) | |
download | podman-e61838bc3b25faba708856e2208aa2026381a341.tar.gz podman-e61838bc3b25faba708856e2208aa2026381a341.tar.bz2 podman-e61838bc3b25faba708856e2208aa2026381a341.zip |
Incorporate image and default environment variables in play kube
Also put Environment variable parsing from image data into a helper function
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'cmd/podman/play_kube.go')
-rw-r--r-- | cmd/podman/play_kube.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/play_kube.go b/cmd/podman/play_kube.go index cbe961279..942794cbe 100644 --- a/cmd/podman/play_kube.go +++ b/cmd/podman/play_kube.go @@ -236,7 +236,6 @@ func getPodPorts(containers []v1.Container) []ocicni.PortMapping { func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container, runtime *libpod.Runtime, newImage *image.Image, namespaces map[string]string, volumes map[string]string) (*createconfig.CreateConfig, error) { var ( containerConfig createconfig.CreateConfig - envs map[string]string ) // The default for MemorySwappiness is -1, not 0 @@ -298,9 +297,10 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container if len(containerConfig.WorkDir) == 0 { containerConfig.WorkDir = "/" } - if len(containerYAML.Env) > 0 { - envs = make(map[string]string) - } + + // Set default environment variables and incorporate data from image, if necessary + envs := shared.EnvVariablesFromData(imageData) + // Environment Variables for _, e := range containerYAML.Env { envs[e.Name] = e.Value |