Skip to content

Commit 018d836

Browse files
fuweidk8s-infra-cherrypick-robot
authored andcommitted
internal/cri: should not apply IoOwner options
When kubelet enables UserNamespaceSupport feature gate, kubelet always uses non-empty UsernsOptions to setup pods. In this case, the gVisor shim is unable to parse runc.Option so that it will be unable to start container. This change is to avoid adding IoOwner options if the UsernsOptions is for node level. Since gVisor hasn't feature subcommand yet, CRI status will report that gVisor runtime doesn't support user namespace. So it's kind of workaround to avoid compatible issue. REF: #11091 Signed-off-by: Wei Fu <[email protected]>
1 parent d93ae62 commit 018d836

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

internal/cri/server/container_start_linux.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,19 @@ func updateContainerIOOwner(ctx context.Context, cntr containerd.Container, conf
3131
return nil, nil
3232
}
3333

34-
// FIXME(fuweid): Ideally, the pipe owner should be aligned with process owner.
35-
// No matter what user namespace container uses, it should work well. However,
36-
// it breaks the sig-node conformance case - [when querying /stats/summary should report resource usage through the stats api].
34+
// FIXME(fuweid):
35+
//
36+
// For builtin runc runtime, the pipe owner should be aligned with process
37+
// owner. No matter what user namespace container uses, it should work
38+
// well.
39+
//
40+
// However, gVisor runtime doesn't support runc.Options and no idea why
41+
// adding options could breaks the sig-node conformance case [when querying /stats/summary should report resource usage through the stats api].
3742
// In order to keep compatible, the change should apply to user namespace only.
38-
if config.GetLinux().GetSecurityContext().GetNamespaceOptions().GetUsernsOptions() == nil {
43+
//
44+
// REF: https://github.com/containerd/containerd/issues/11091
45+
usernsOpts := config.GetLinux().GetSecurityContext().GetNamespaceOptions().GetUsernsOptions()
46+
if usernsOpts == nil || usernsOpts.Mode == runtime.NamespaceMode_NODE {
3947
return nil, nil
4048
}
4149

0 commit comments

Comments
 (0)