Merge pull request #23384 from edsantiago/root-namespace

CI: enable root user namespaces
This commit is contained in:
openshift-merge-bot[bot]
2024-08-01 10:32:16 +00:00
committed by GitHub
6 changed files with 31 additions and 18 deletions

View File

@ -2374,7 +2374,7 @@ func (c *Container) setupOCIHooks(ctx context.Context, config *spec.Spec) (map[s
// the container's mountpoint directly from the storage.
// Otherwise, it returns an intermediate mountpoint that is accessible to anyone.
func (c *Container) getRootPathForOCI() (string, error) {
if hasCurrentUserMapped(c) {
if hasCurrentUserMapped(c) || c.config.RootfsMapping != nil {
return c.state.Mountpoint, nil
}
return c.getIntermediateMountpointUser()

View File

@ -183,7 +183,7 @@ func hasCurrentUserMapped(ctr *Container) bool {
// CreateContainer creates a container.
func (r *ConmonOCIRuntime) CreateContainer(ctr *Container, restoreOptions *ContainerCheckpointOptions) (int64, error) {
if !hasCurrentUserMapped(ctr) {
if !hasCurrentUserMapped(ctr) || ctr.config.RootfsMapping != nil {
// if we are running a non privileged container, be sure to umount some kernel paths so they are not
// bind mounted inside the container at all.
hideFiles := !ctr.config.Privileged && !rootless.IsRootless()