diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-02 10:42:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-02 10:42:46 +0200 |
commit | 5370c53c9c22627385e9bc765dbd1fcfedc09694 (patch) | |
tree | 4c5806942b102326e441f746d9c0538adb901bbc /pkg/adapter | |
parent | 2cc5913bed1fb16690eb27c6e636867a5946070e (diff) | |
parent | 834107c82ea50c3299d23c07c04f81b6974202f9 (diff) | |
download | podman-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/adapter')
-rw-r--r-- | pkg/adapter/pods.go | 9 |
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{} |