diff options
Diffstat (limited to 'pkg')
-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 b9d7fcd9b..c3a9ab8d8 100644 --- a/pkg/adapter/pods.go +++ b/pkg/adapter/pods.go @@ -682,6 +682,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{} |