summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-10 09:12:54 -0400
committerGitHub <noreply@github.com>2021-05-10 09:12:54 -0400
commit195895eb7e1924b7dcf049ca5067f35795f74595 (patch)
tree911bfd82a077d6afd179c61ae4c1601a82081497 /pkg
parent9e0aa474a97b59c8540b5c9316fe98220d713d06 (diff)
parent14a1a4546c9d3adc28ad082e97be893e41b29ce2 (diff)
downloadpodman-195895eb7e1924b7dcf049ca5067f35795f74595.tar.gz
podman-195895eb7e1924b7dcf049ca5067f35795f74595.tar.bz2
podman-195895eb7e1924b7dcf049ca5067f35795f74595.zip
Merge pull request #10268 from flouthoc/kube-default-shared-namespace
Kube like pods should share ipc,net,uts by default
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/kube/kube.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go
index ccce3edba..4e41061a5 100644
--- a/pkg/specgen/generate/kube/kube.go
+++ b/pkg/specgen/generate/kube/kube.go
@@ -23,6 +23,10 @@ func ToPodGen(ctx context.Context, podName string, podYAML *v1.PodTemplateSpec)
p := specgen.NewPodSpecGenerator()
p.Name = podName
p.Labels = podYAML.ObjectMeta.Labels
+ // Kube pods must share {ipc, net, uts} by default
+ p.SharedNamespaces = append(p.SharedNamespaces, "ipc")
+ p.SharedNamespaces = append(p.SharedNamespaces, "net")
+ p.SharedNamespaces = append(p.SharedNamespaces, "uts")
// TODO we only configure Process namespace. We also need to account for Host{IPC,Network,PID}
// which is not currently possible with pod create
if podYAML.Spec.ShareProcessNamespace != nil && *podYAML.Spec.ShareProcessNamespace {