Merge pull request #23266 from TomSweeneyRedHat/dev/tsweeney/accel244-v4.4.1-rhel

[v4.4.1-rhel] builds try to write to additionalImageStore
This commit is contained in:
openshift-merge-bot[bot]
2024-07-22 19:22:13 +00:00
committed by GitHub
15 changed files with 53 additions and 46 deletions

View File

@ -170,7 +170,7 @@ Show only Podman create events
```
$ podman events -f event=create
2019-03-02 10:36:01.375685062 -0600 CST container create 20dc581f6fbf (image=docker.io/library/alpine:latest, name=sharp_morse)
2019-03-02 10:36:08.561188337 -0600 CST container create 58e7e002344c (image=k8s.gcr.io/pause:3.1, name=3e701f270d54-infra)
2019-03-02 10:36:08.561188337 -0600 CST container create 58e7e002344c (image=registry.k8s.io/pause:3.1, name=3e701f270d54-infra)
2019-03-02 10:36:13.146899437 -0600 CST volume create cad6dc50e087 (image=, name=cad6dc50e0879568e7d656bd004bd343d6035e7fc4024e1711506fe2fd459e6f)
2019-03-02 10:36:29.978806894 -0600 CST container create d81e30f1310f (image=docker.io/library/busybox:latest, name=musing_newton)
```
@ -186,9 +186,9 @@ $ podman events --filter event=create --filter type=pod
Show only Podman events created in the last five minutes:
```
$ sudo podman events --since 5m
2019-03-02 10:44:29.598835409 -0600 CST container create b629d10d3831 (image=k8s.gcr.io/pause:3.1, name=1df5ebca7b44-infra)
2019-03-02 10:44:29.598835409 -0600 CST container create b629d10d3831 (image=registry.k8s.io/pause:3.1, name=1df5ebca7b44-infra)
2019-03-02 10:44:29.601746633 -0600 CST pod create 1df5ebca7b44 (image=, name=confident_hawking)
2019-03-02 10:44:42.371100253 -0600 CST container create 170a0f457d00 (image=k8s.gcr.io/pause:3.1, name=ca731231718e-infra)
2019-03-02 10:44:42.371100253 -0600 CST container create 170a0f457d00 (image=registry.k8s.io/pause:3.1, name=ca731231718e-infra)
2019-03-02 10:44:42.374637304 -0600 CST pod create ca731231718e (image=, name=webapp)
```

2
go.mod
View File

@ -17,7 +17,7 @@ require (
github.com/containers/image/v5 v5.24.1
github.com/containers/ocicrypt v1.1.10
github.com/containers/psgo v1.8.0
github.com/containers/storage v1.45.6
github.com/containers/storage v1.45.7
github.com/coreos/go-systemd/v22 v22.5.0
github.com/coreos/stream-metadata-go v0.0.0-20210225230131-70edb9eb47b3
github.com/cyphar/filepath-securejoin v0.2.4

4
go.sum
View File

@ -289,8 +289,8 @@ github.com/containers/psgo v1.8.0 h1:2loGekmGAxM9ir5OsXWEfGwFxorMPYnc6gEDsGFQvhY
github.com/containers/psgo v1.8.0/go.mod h1:T8ZxnX3Ur4RvnhxFJ7t8xJ1F48RhiZB4rSrOaR/qGHc=
github.com/containers/storage v1.37.0/go.mod h1:kqeJeS0b7DO2ZT1nVWs0XufrmPFbgV3c+Q/45RlH6r4=
github.com/containers/storage v1.43.0/go.mod h1:uZ147thiIFGdVTjMmIw19knttQnUCl3y9zjreHrg11s=
github.com/containers/storage v1.45.6 h1:BSx9hgpzLMJR93yuvpHGdQBNNLuGYbsGvldYWKmgTF0=
github.com/containers/storage v1.45.6/go.mod h1:OdRUYHrq1HP6iAo79VxqtYuJzC5j4eA2I60jKOoCT7g=
github.com/containers/storage v1.45.7 h1:5/szZryilhi8sjKo/v8E8HwJhbyBDq2IyWEqvgb8jpo=
github.com/containers/storage v1.45.7/go.mod h1:OdRUYHrq1HP6iAo79VxqtYuJzC5j4eA2I60jKOoCT7g=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU=

View File

@ -3424,7 +3424,7 @@ type ConfigMapNodeConfigSource struct {
// Describe a container image
type ContainerImage struct {
// Names by which this image is known.
// e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
// e.g. ["registry.k8s.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
// +optional
Names []string `json:"names"`
// The size of the image in bytes.

View File

@ -10,7 +10,7 @@ var (
ALPINEAMD64ID = "961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4"
ALPINEARM64DIGEST = "quay.io/libpod/alpine@sha256:f270dcd11e64b85919c3bab66886e59d677cf657528ac0e4805d3c71e458e525"
ALPINEARM64ID = "915beeae46751fc564998c79e73a1026542e945ca4f73dc841d09ccc6c2c0672"
INFRA_IMAGE = "k8s.gcr.io/pause:3.2" //nolint:revive,stylecheck
INFRA_IMAGE = "quay.io/libpod/k8s-pause:3.5" //nolint:revive,stylecheck
BB = "quay.io/libpod/busybox:latest"
HEALTHCHECK_IMAGE = "quay.io/libpod/alpine_healthcheck:latest" //nolint:revive,stylecheck
ImageCacheDir = "/tmp/podman/imagecachedir"

View File

@ -143,7 +143,7 @@ var _ = Describe("Podman images", func() {
result := podmanTest.Podman([]string{"images", "-q", "-f", "reference=quay.io/libpod/*"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result.OutputToStringArray()).To(HaveLen(8))
Expect(result.OutputToStringArray()).To(HaveLen(9))
retalpine := podmanTest.Podman([]string{"images", "-f", "reference=*lpine*"})
retalpine.WaitWithDefaultTimeout()

View File

@ -23,8 +23,8 @@ var _ = Describe("Podman manifest", func() {
)
const (
imageList = "docker://k8s.gcr.io/pause:3.1"
imageListInstance = "docker://k8s.gcr.io/pause@sha256:f365626a556e58189fc21d099fc64603db0f440bff07f77c740989515c544a39"
imageList = "docker://registry.k8s.io/pause:3.1"
imageListInstance = "docker://registry.k8s.io/pause@sha256:f365626a556e58189fc21d099fc64603db0f440bff07f77c740989515c544a39"
imageListARM64InstanceDigest = "sha256:f365626a556e58189fc21d099fc64603db0f440bff07f77c740989515c544a39"
imageListAMD64InstanceDigest = "sha256:59eec8837a4d942cc19a52b8c09ea75121acc38114a2c68b98983ce9356b8610"
imageListARMInstanceDigest = "sha256:c84b0a3a07b628bc4d62e5047d0f8dff80f7c00979e1e28a821a033ecda8fe53"

View File

@ -1818,7 +1818,7 @@ var _ = Describe("Podman play kube", func() {
It("podman play kube should use customized infra_image", func() {
conffile := filepath.Join(podmanTest.TempDir, "container.conf")
infraImage := "k8s.gcr.io/pause:3.2"
infraImage := INFRA_IMAGE
err := os.WriteFile(conffile, []byte(fmt.Sprintf("[engine]\ninfra_image=\"%s\"\n", infraImage)), 0644)
Expect(err).ToNot(HaveOccurred())

View File

@ -176,10 +176,10 @@ load helpers
reported_mountpoint=$(echo "$output" | awk '{print $2}')
is $reported_mountpoint $mount_path "mountpoint reported by 'podman mount'"
# umount, and make sure files are gone
# umount, and make sure mountpoint no longer exists
run_podman umount $external_cid
if [ -d "$mount_path" ]; then
die "'podman umount' did not umount"
if findmnt "$mount_path" >/dev/null ; then
die "'podman umount' did not umount $mount_path"
fi
buildah rm $external_cid
}

View File

@ -325,7 +325,7 @@ EOF
@test "podman pod create should fail when infra-name is already in use" {
local infra_name="infra_container_$(random_string 10 | tr A-Z a-z)"
local infra_image="k8s.gcr.io/pause:3.5"
local infra_image="quay.io/libpod/k8s-pause:3.5"
local pod_name="$(random_string 10 | tr A-Z a-z)"
run_podman --noout pod create --name $pod_name --infra-name "$infra_name" --infra-image "$infra_image"

View File

@ -80,8 +80,8 @@ RELABEL="system_u:object_r:container_file_t:s0"
# Make sure that the K8s pause image isn't pulled but the local podman-pause is built.
run_podman images
run_podman 1 image exists k8s.gcr.io/pause
run_podman version --format "{{.Server.Version}}-{{.Server.Built}}"
run_podman image exists localhost/podman-pause:$output
run_podman 1 image exists registry.k8s.io/pause
run_podman image exists $(pause_image)
run_podman stop -a -t 0
run_podman pod rm -t 0 -f test_pod

View File

@ -56,8 +56,6 @@ gce_instance:
fedora_testing_task: &fedora_testing
alias: fedora_testing
name: &std_test_name "${OS_NAME} ${TEST_DRIVER}"
depends_on:
- lint
gce_instance: # Only need to specify differences from defaults (above)
image_name: "${VM_IMAGE}"
@ -104,21 +102,6 @@ ubuntu_testing_task: &ubuntu_testing
TEST_DRIVER: "overlay"
lint_task:
env:
CIRRUS_WORKING_DIR: "/go/src/github.com/containers/storage"
container:
image: golang:1.17
modules_cache:
fingerprint_script: cat go.sum
folder: $GOPATH/pkg/mod
build_script: |
echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list
apt-get update
apt-get install -y libbtrfs-dev libdevmapper-dev
test_script: make TAGS=regex_precompile local-validate && make lint && make clean
# Update metadata on VM images referenced by this repository state
meta_task:
@ -155,7 +138,6 @@ vendor_task:
# Represent overall pass/fail status from required dependent tasks
success_task:
depends_on:
- lint
- fedora_testing
- ubuntu_testing
- meta

View File

@ -1 +1 @@
1.45.6
1.45.7

View File

@ -1469,14 +1469,22 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
}
diffDir := path.Join(dir, "diff")
if err := idtools.MkdirAllAs(diffDir, perms, rootUID, rootGID); err != nil {
if !inAdditionalStore {
return "", err
}
// if it is in an additional store, do not fail if the directory already exists
if _, err2 := os.Stat(diffDir); err2 != nil {
return "", err
}
}
mergedDir := path.Join(dir, "merged")
// Create the driver merged dir
if err := idtools.MkdirAs(mergedDir, 0700, rootUID, rootGID); err != nil && !os.IsExist(err) {
// Attempt to create the merged dir only if it doesn't exist.
if _, err := os.Stat(mergedDir); err != nil && os.IsNotExist(err) {
if err := idtools.MkdirAs(mergedDir, 0o700, rootUID, rootGID); err != nil && !os.IsExist(err) {
return "", err
}
}
if count := d.ctr.Increment(mergedDir); count > 1 {
return mergedDir, nil
}
@ -1633,7 +1641,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
// Put unmounts the mount path created for the give id.
func (d *Driver) Put(id string) error {
dir := d.dir(id)
dir, inAdditionalStore := d.dir2(id)
if _, err := os.Stat(dir); err != nil {
return err
}
@ -1691,10 +1699,27 @@ func (d *Driver) Put(id string) error {
}
}
if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) {
logrus.Debugf("Failed to remove mountpoint %s overlay: %s - %v", id, mountpoint, err)
if !inAdditionalStore {
uid, gid := int(0), int(0)
fi, err := os.Stat(mountpoint)
if err != nil {
return err
}
if stat, ok := fi.Sys().(*syscall.Stat_t); ok {
uid, gid = int(stat.Uid), int(stat.Gid)
}
tmpMountpoint := path.Join(dir, "merged.1")
if err := idtools.MkdirAs(tmpMountpoint, 0o700, uid, gid); err != nil && !errors.Is(err, os.ErrExist) {
return err
}
// rename(2) can be used on an empty directory, as it is the mountpoint after umount, and it retains
// its atomic semantic. In this way the "merged" directory is never removed.
if err := unix.Rename(tmpMountpoint, mountpoint); err != nil {
logrus.Debugf("Failed to replace mountpoint %s overlay: %s - %v", id, mountpoint, err)
return fmt.Errorf("replacing mount point %q: %w", mountpoint, err)
}
}
return nil
}

2
vendor/modules.txt vendored
View File

@ -284,7 +284,7 @@ github.com/containers/psgo/internal/dev
github.com/containers/psgo/internal/host
github.com/containers/psgo/internal/proc
github.com/containers/psgo/internal/process
# github.com/containers/storage v1.45.6
# github.com/containers/storage v1.45.7
## explicit; go 1.17
github.com/containers/storage
github.com/containers/storage/drivers