diff --git a/.cirrus.yml b/.cirrus.yml index 2f3ba3cb9..b792df8d1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -17,13 +17,13 @@ env: #### #### Cache-image names to test with (double-quotes around names are critical) ### - FEDORA_NAME: "fedora-36" - UBUNTU_NAME: "ubuntu-2204" + FEDORA_NAME: "fedora-37" ### 20230120t152650z-f37f36u2204 + UBUNTU_NAME: "ubuntu-2204" ### 20230120t152650z-f37f36u2204 # GCE project where images live IMAGE_PROJECT: "libpod-218412" # VM Image built in containers/automation_images - IMAGE_SUFFIX: "c5878804328480768" + IMAGE_SUFFIX: "c20230120t152650z-f37f36u2204" FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}" UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${IMAGE_SUFFIX}" diff --git a/drivers/overlay/overlay.go b/drivers/overlay/overlay.go index be7406b9a..aaef45f08 100644 --- a/drivers/overlay/overlay.go +++ b/drivers/overlay/overlay.go @@ -1505,7 +1505,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO } } - if d.supportsIDmappedMounts() && len(options.UidMaps) > 0 && len(options.GidMaps) > 0 { + if !disableShifting && len(options.UidMaps) > 0 && len(options.GidMaps) > 0 { var newAbsDir []string mappedRoot := filepath.Join(d.home, id, "mapped") if err := os.MkdirAll(mappedRoot, 0700); err != nil { @@ -2098,8 +2098,8 @@ func (d *Driver) supportsIDmappedMounts() bool { // SupportsShifting tells whether the driver support shifting of the UIDs/GIDs in an userNS func (d *Driver) SupportsShifting() bool { - if os.Getenv("_TEST_FORCE_SUPPORT_SHIFTING") == "yes-please" { - return true + if os.Getenv("_CONTAINERS_OVERLAY_DISABLE_IDMAP") == "yes" { + return false } if d.options.mountProgram != "" { return true diff --git a/tests/helpers.bash b/tests/helpers.bash index 831e06d91..5f9ef2bbe 100755 --- a/tests/helpers.bash +++ b/tests/helpers.bash @@ -21,6 +21,9 @@ function setup() { TESTDIR=${BATS_TMPDIR}/tmp.${suffix} rm -fr ${TESTDIR} mkdir -p ${TESTDIR}/{root,runroot} + # disable idmapped mounts in the overlay driver, since that + # is the expectation in the idmaps.bats tests. + export _CONTAINERS_OVERLAY_DISABLE_IDMAP=yes } # Delete the unique root directory and a runroot directory. diff --git a/tests/idmaps.bats b/tests/idmaps.bats index c08358f75..2267a5352 100644 --- a/tests/idmaps.bats +++ b/tests/idmaps.bats @@ -961,30 +961,6 @@ load helpers imagename=idmappedimage-shifting storage create-image --name=$imagename $lowerlayer - - _TEST_FORCE_SUPPORT_SHIFTING=yes-please run storage --debug=false create-container --uidmap 0:1000:1000 --gidmap 0:1000:1000 $imagename - echo "$output" - [ "$status" -eq 0 ] - [ "$output" != "" ] - - container="$output" - - # Mount the container. - _TEST_FORCE_SUPPORT_SHIFTING=yes-please run storage --debug=false mount $container - echo "$output" - [ "$status" -eq 0 ] - dir="$output" - test "$(stat -c%u:%g $dir/file)" == "0:0" - _TEST_FORCE_SUPPORT_SHIFTING=yes-please run storage --debug=false unmount "$container" - [ "$status" -eq 0 ] - - # Remove the container and image and check that all of the layers we used got removed. - _TEST_FORCE_SUPPORT_SHIFTING=yes-please run storage --debug=false delete-container $container - _TEST_FORCE_SUPPORT_SHIFTING=yes-please run storage --debug=false delete-image $imagename - _TEST_FORCE_SUPPORT_SHIFTING=yes-please run storage --debug=false layers - echo "$output" - [ "$status" -eq 0 ] - [ "$output" == "" ] } @test "idmaps-create-layer-from-another-image-store" {