summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-22 09:47:44 +0200
committerGitHub <noreply@github.com>2019-05-22 09:47:44 +0200
commita4c42c6c6c8a70a0123c4bb4c5b7aad4096c8dfa (patch)
treeba3685512bba6f8c5db2badac7c40927b6fbf5db /cmd
parent6f02f3b2bc58925bfb8c97c897f58473f09e1219 (diff)
parent968bcbc86b8fa26383ae2d4809b04aac288355f0 (diff)
downloadpodman-a4c42c6c6c8a70a0123c4bb4c5b7aad4096c8dfa.tar.gz
podman-a4c42c6c6c8a70a0123c4bb4c5b7aad4096c8dfa.tar.bz2
podman-a4c42c6c6c8a70a0123c4bb4c5b7aad4096c8dfa.zip
Merge pull request #3178 from mheon/fix_gen_kube
Fix a 'generate kube' bug on ctrs with named volumes
Diffstat (limited to 'cmd')
-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"