From b80b95eea0c2f32de6101e558ce5314e1bd08c25 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Thu, 10 Sep 2020 17:22:53 -0400 Subject: play/generate: support shareProcessNamespace this is an option that allows a user to specify whether to share PID namespace in the pod for play kube and generate kube associated test added Signed-off-by: Peter Hunt --- libpod/kube.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libpod') diff --git a/libpod/kube.go b/libpod/kube.go index 5f2c9e0fd..c4367db2f 100644 --- a/libpod/kube.go +++ b/libpod/kube.go @@ -69,12 +69,20 @@ func (p *Pod) GenerateForKube() (*v1.Pod, []v1.ServicePort, error) { return nil, servicePorts, err } servicePorts = containerPortsToServicePorts(ports) + } pod, err := p.podWithContainers(allContainers, ports) if err != nil { return nil, servicePorts, err } pod.Spec.HostAliases = extraHost + + if p.SharesPID() { + // unfortunately, go doesn't have a nice way to specify a pointer to a bool + b := true + pod.Spec.ShareProcessNamespace = &b + } + return pod, servicePorts, nil } -- cgit v1.2.3-54-g00ecf