mirror of
https://github.com/containerd/containerd.git
synced 2026-08-03 14:40:45 +00:00
Update ctr to support remapper labels with multiple uid/gid mapping entries
Signed-off-by: Henry Wang <henwang@amazon.com>
This commit is contained in:
@@ -175,11 +175,7 @@ func NewContainer(ctx context.Context, client *containerd.Client, cliContext *cl
|
||||
// fuse-overlayfs - https://github.com/containerd/fuse-overlayfs-snapshotter
|
||||
// overlay - in case of idmapped mount points are supported by host kernel (Linux kernel 5.19)
|
||||
if cliContext.Bool("remap-labels") {
|
||||
// TODO: the optimization code path on id mapped mounts only supports single mapping entry today.
|
||||
if len(uidSpec) > 1 || len(gidSpec) > 1 {
|
||||
return nil, errors.New("'remap-labels' option does not support multiple mappings")
|
||||
}
|
||||
cOpts = append(cOpts, containerd.WithNewSnapshot(id, image, containerd.WithRemapperLabels(0, uidSpec[0].HostID, 0, gidSpec[0].HostID, uidSpec[0].Size)))
|
||||
cOpts = append(cOpts, containerd.WithNewSnapshot(id, image, containerd.WithUserNSRemapperLabels(uidSpec, gidSpec)))
|
||||
} else {
|
||||
cOpts = append(cOpts, containerd.WithUserNSRemappedSnapshot(id, image, uidSpec, gidSpec))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user