summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-02 10:42:46 +0200
committerGitHub <noreply@github.com>2019-08-02 10:42:46 +0200
commit5370c53c9c22627385e9bc765dbd1fcfedc09694 (patch)
tree4c5806942b102326e441f746d9c0538adb901bbc /pkg
parent2cc5913bed1fb16690eb27c6e636867a5946070e (diff)
parent834107c82ea50c3299d23c07c04f81b6974202f9 (diff)
downloadpodman-5370c53c9c22627385e9bc765dbd1fcfedc09694.tar.gz
podman-5370c53c9c22627385e9bc765dbd1fcfedc09694.tar.bz2
podman-5370c53c9c22627385e9bc765dbd1fcfedc09694.zip
Merge pull request #3692 from haircommander/play-caps
Add Capability support to play kube
Diffstat (limited to 'pkg')
-rw-r--r--pkg/adapter/pods.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/adapter/pods.go b/pkg/adapter/pods.go
index 2a52cfd0c..e25238956 100644
--- a/pkg/adapter/pods.go
+++ b/pkg/adapter/pods.go
@@ -683,6 +683,15 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container
if containerYAML.SecurityContext.AllowPrivilegeEscalation != nil {
containerConfig.NoNewPrivs = !*containerYAML.SecurityContext.AllowPrivilegeEscalation
}
+
+ }
+ if caps := containerYAML.SecurityContext.Capabilities; caps != nil {
+ for _, capability := range caps.Add {
+ containerConfig.CapAdd = append(containerConfig.CapAdd, string(capability))
+ }
+ for _, capability := range caps.Drop {
+ containerConfig.CapDrop = append(containerConfig.CapDrop, string(capability))
+ }
}
containerConfig.Command = []string{}