summaryrefslogtreecommitdiff
path: root/libpod/kube.go
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2020-09-10 17:22:53 -0400
committerPeter Hunt <pehunt@redhat.com>2020-09-10 17:22:55 -0400
commitb80b95eea0c2f32de6101e558ce5314e1bd08c25 (patch)
tree6f018ff8ddb629b7a976b574f8ca67303ec2e9e1 /libpod/kube.go
parent96bc5eb4b77d00f59a342b7af1f6f3ecd35772a5 (diff)
downloadpodman-b80b95eea0c2f32de6101e558ce5314e1bd08c25.tar.gz
podman-b80b95eea0c2f32de6101e558ce5314e1bd08c25.tar.bz2
podman-b80b95eea0c2f32de6101e558ce5314e1bd08c25.zip
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 <pehunt@redhat.com>
Diffstat (limited to 'libpod/kube.go')
-rw-r--r--libpod/kube.go8
1 files changed, 8 insertions, 0 deletions
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
}