cri/server: Pass down uidMappings to OCI runtime
When the kubelet sends the uid/gid mappings for a mount, just pass them down to the OCI runtime. OCI runtimes support this since runc 1.2 and crun 1.8.1. And whenever we add mounts (container mounts or image spec volumes) and userns are requested by the kubelet, we use those mappings in the mounts so the mounts are idmapped correctly. If no userns is used, we don't send any mappings which just keeps the current behavior. Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
This commit is contained in:
@@ -279,8 +279,9 @@ func TestVolumeMounts(t *testing.T) {
|
||||
config := &imagespec.ImageConfig{
|
||||
Volumes: test.imageVolumes,
|
||||
}
|
||||
containerConfig := &runtime.ContainerConfig{Mounts: test.criMounts}
|
||||
c := newTestCRIService()
|
||||
got := c.volumeMounts(testContainerRootDir, test.criMounts, config)
|
||||
got := c.volumeMounts(testContainerRootDir, containerConfig, config)
|
||||
assert.Len(t, got, len(test.expectedMountDest))
|
||||
for _, dest := range test.expectedMountDest {
|
||||
found := false
|
||||
|
||||
Reference in New Issue
Block a user