summaryrefslogtreecommitdiff
path: root/cmd/podman/play_kube.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-05-21 14:18:42 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-21 14:18:42 -0400
commite59083f41f6a825c323386d646d68865c82049f5 (patch)
tree8259d9950986ade369cfb6b0521ab006195a4573 /cmd/podman/play_kube.go
parent03824e04fdcc4a4f72741db9aa0962ecedf78ac3 (diff)
downloadpodman-e59083f41f6a825c323386d646d68865c82049f5.tar.gz
podman-e59083f41f6a825c323386d646d68865c82049f5.tar.bz2
podman-e59083f41f6a825c323386d646d68865c82049f5.zip
Fix play kube when a pod is specified
We need to pass the Pod ID in as part of the CreateConfig. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/play_kube.go')
-rw-r--r--cmd/podman/play_kube.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/podman/play_kube.go b/cmd/podman/play_kube.go
index e778bafb9..8d824eacb 100644
--- a/cmd/podman/play_kube.go
+++ b/cmd/podman/play_kube.go
@@ -217,7 +217,7 @@ func playKubeYAMLCmd(c *cliconfig.KubePlayValues, ctx context.Context, runtime *
if err != nil {
return pod, err
}
- createConfig, err := kubeContainerToCreateConfig(ctx, container, runtime, newImage, namespaces, volumes)
+ createConfig, err := kubeContainerToCreateConfig(ctx, container, runtime, newImage, namespaces, volumes, pod.ID())
if err != nil {
return pod, err
}
@@ -274,7 +274,7 @@ func getPodPorts(containers []v1.Container) []ocicni.PortMapping {
}
// kubeContainerToCreateConfig takes a v1.Container and returns a createconfig describing a container
-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) {
+func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container, runtime *libpod.Runtime, newImage *image.Image, namespaces map[string]string, volumes map[string]string, podID string) (*createconfig.CreateConfig, error) {
var (
containerConfig createconfig.CreateConfig
)
@@ -288,6 +288,8 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container
containerConfig.Tty = containerYAML.TTY
containerConfig.WorkDir = containerYAML.WorkingDir
+ containerConfig.Pod = podID
+
imageData, _ := newImage.Inspect(ctx)
containerConfig.User = "0"