diff options
Diffstat (limited to 'cmd/podman/play_kube.go')
-rw-r--r-- | cmd/podman/play_kube.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/podman/play_kube.go b/cmd/podman/play_kube.go index 982e12d44..d60c873f8 100644 --- a/cmd/podman/play_kube.go +++ b/cmd/podman/play_kube.go @@ -44,6 +44,7 @@ var ( RunE: func(cmd *cobra.Command, args []string) error { playKubeCommand.InputArgs = args playKubeCommand.GlobalFlags = MainGlobalOpts + playKubeCommand.Remote = remoteclient return playKubeYAMLCmd(&playKubeCommand) }, Example: `podman play kube demo.yml @@ -254,7 +255,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 @@ -316,9 +316,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 |