Skip to content

CRI: Support Linux username for !linux platforms#8464

Merged
AkihiroSuda merged 1 commit intocontainerd:mainfrom
dcantah:user-nonlinux
May 14, 2023
Merged

CRI: Support Linux username for !linux platforms#8464
AkihiroSuda merged 1 commit intocontainerd:mainfrom
dcantah:user-nonlinux

Conversation

@dcantah
Copy link
Copy Markdown
Member

@dcantah dcantah commented May 2, 2023

The oci.WithUser option was being applied in container_create_linux.go
instead of the cross plat buildLinuxSpec method. There's been recent
work to try and make every spec option that can be applied on any platform
able to do so, and this falls under that. However, WithUser on linux platforms
relies on the containers SnapshotKey being filled out, which means the spec
option needs to be applied during container creation.

To make this a little more generic, I've created a new platformSpecOpts
method that handles any spec opts that rely on runtime state (rootfs mounted
for example) for some platforms, or just platform options that we still don't
have workarounds for to be able to specify them for other platforms
(apparmor, seccomp etc.) by internally calling the already existing
containerSpecOpts method.

@dcantah dcantah added area/cri Container Runtime Interface (CRI) kind/enhancement labels May 2, 2023
@dcantah dcantah marked this pull request as draft May 2, 2023 06:07
The oci.WithUser option was being applied in container_create_linux.go
instead of the cross plat buildLinuxSpec method. There's been recent
work to try and make every spec option that can be applied on any platform
able to do so, and this falls under that. However, WithUser on linux platforms
relies on the containers SnapshotKey being filled out, which means the spec
option needs to be applied during container creation.

To make this a little more generic, I've created a new platformSpecOpts
method that handles any spec opts that rely on runtime state (rootfs mounted
for example) for some platforms, or just platform options that we still don't
have workarounds for to be able to specify them for other platforms
(apparmor, seccomp etc.) by internally calling the already existing
containerSpecOpts method.

Signed-off-by: Danny Canter <[email protected]>
@dcantah dcantah marked this pull request as ready for review May 11, 2023 20:49
@dmcgowan dmcgowan added the cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch label May 11, 2023
@AkihiroSuda AkihiroSuda merged commit 8eea15f into containerd:main May 14, 2023
@samuelkarp samuelkarp added cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch kind/enhancement

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants