Skip to content

Commit

Permalink
kube: record infra user namespace
Browse files Browse the repository at this point in the history
if there is an annotation that specifies the user namespace for the
infra container, then make sure it is used for the entire pod.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jul 24, 2024
1 parent bf8c306 commit 61f0230
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libpod/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ func (p *Pod) podWithContainers(ctx context.Context, containers []*Container, po

for _, ctr := range containers {
if ctr.IsInfra() {
// If there is an user namespace for the infra container, then register it for the entire pod.
if v, found := ctr.config.Spec.Annotations[define.UserNsAnnotation]; found {
podAnnotations[define.UserNsAnnotation] = v
}
_, _, infraDNS, _, err := containerToV1Container(ctx, ctr, getService)
if err != nil {
return nil, err
Expand Down

0 comments on commit 61f0230

Please sign in to comment.