Skip to content

Conversation

@Iceber
Copy link
Member

@Iceber Iceber commented Dec 23, 2022

ctr tasks start supports resolving to uid/gid mappings from spec.

For ctr run, the NewContainer function will also set the uid/gid mapping.

if uidmap, gidmap := context.String("uidmap"), context.String("gidmap"); uidmap != "" && gidmap != "" {
uidMap, err := parseIDMapping(uidmap)
if err != nil {
return nil, err
}
gidMap, err := parseIDMapping(gidmap)
if err != nil {
return nil, err
}
opts = append(opts,
oci.WithUserNamespace([]specs.LinuxIDMapping{uidMap}, []specs.LinuxIDMapping{gidMap}))
// use snapshotter opts or the remapped snapshot support to shift the filesystem

For uid/gid mappings that already exist in the container spec, there is no need for the ctr tasks start command to ignore it

@k8s-ci-robot
Copy link

Hi @Iceber. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Iceber
Copy link
Member Author

Iceber commented Jan 4, 2023

@estesp @AkihiroSuda PTAL, Thanks

@Iceber
Copy link
Member Author

Iceber commented Feb 28, 2023

@fuweid PTAL, Thanks

@fuweid
Copy link
Member

fuweid commented Mar 2, 2023

@Iceber code looks good to me. But we have batch update in pass two months. Would you please rebase the main branch to run the CI again? Thanks

@Iceber
Copy link
Member Author

Iceber commented Mar 2, 2023

@fuweid rebased, and it is green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants