summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/kube
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-05-08 00:36:45 +0530
committerflouthoc <flouthoc.git@gmail.com>2021-05-10 11:29:11 +0530
commit14a1a4546c9d3adc28ad082e97be893e41b29ce2 (patch)
tree3d286b5d9e41815d2a5251c6619dd554d68f3cbc /pkg/specgen/generate/kube
parent54bed1025d07bc5f77ee4e1e7f942157e211ec0a (diff)
downloadpodman-14a1a4546c9d3adc28ad082e97be893e41b29ce2.tar.gz
podman-14a1a4546c9d3adc28ad082e97be893e41b29ce2.tar.bz2
podman-14a1a4546c9d3adc28ad082e97be893e41b29ce2.zip
Kube like pods should share ipc,net,uts by default
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Diffstat (limited to 'pkg/specgen/generate/kube')
-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 {