Bug 2233218
| Summary: | Containers created with --restart=always do not restart when started through a pod | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Tom Sweeney <tsweeney> | |
| Component: | podman | Assignee: | Valentin Rothberg <vrothber> | |
| Status: | CLOSED ERRATA | QA Contact: | Alex Jia <ajia> | |
| Severity: | high | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 8.9 | CC: | ajia, bbaude, dwalsh, jligon, jnovy, lsm5, mboddu, mheon, pthomas, tsweeney, vrothber | |
| Target Milestone: | rc | Keywords: | Triaged | |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | x86_64 | |||
| OS: | FreeBSD | |||
| Whiteboard: | ||||
| Fixed In Version: | podman-4.6.1-3.el8 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 2233222 (view as bug list) | Environment: | ||
| Last Closed: | 2023-11-14 15:30:48 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 2233222 | |||
| Deadline: | 2023-08-15 | |||
|
Description
Tom Sweeney
2023-08-21 18:19:01 UTC
@vrothber please backport this fix to the Podman v4.6.1-rhel branch. Once merged, please set this to post, assign to Jindrich, and set needinfo for him. Backport has merged: https://github.com/containers/podman/pull/19692 Assigning to Jindrich. [root@kvm-02-guest03 ~]# cat /etc/redhat-release Red Hat Enterprise Linux release 9.3 Beta (Plow) [root@kvm-02-guest03 ~]# rpm -q podman podman-tests crun systemd kernel podman-4.6.1-3.el9.x86_64 podman-tests-4.6.1-3.el9.x86_64 crun-1.8.6-1.el9.x86_64 systemd-252-17.el9.x86_64 kernel-5.14.0-356.el9.x86_64 [root@kvm-02-guest03 ~]# cd /usr/share/podman/ [root@kvm-02-guest03 podman]# bats -t -f "podman pod create restart tests" test/system/ 1..1 ok 1 podman pod create restart tests
[root@kvm-02-guest12 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.9 Beta (Ootpa)
[root@kvm-02-guest12 ~]# rpm -q podman podman-tests crun systemd kernel
podman-4.6.1-3.module+el8.9.0+19731+94cfa27e.x86_64
podman-tests-4.6.1-3.module+el8.9.0+19731+94cfa27e.x86_64
crun-1.8.7-1.module+el8.9.0+19731+94cfa27e.x86_64
systemd-239-77.el8.x86_64
kernel-4.18.0-511.el8.x86_64
[root@kvm-02-guest12 ~]# cd /usr/share/podman/
[root@kvm-02-guest12 podman]# grep -n "podman pod create restart tests" test/system/200-pod.bats
[root@kvm-02-guest12 podman]#
NOTE: the 'podman pod create restart tests' case is not included by
podman-tests-4.6.1-3.module+el8.9.0+19731+94cfa27e rpm package.
And added the following testing into test/system/200-pod.bats manually then test it.
<slice>
@test "podman pod create restart tests" {
podname=pod$(random_string)
run_podman pod create --restart=on-failure --name $podname
run_podman create --name test-ctr --pod $podname $IMAGE
run_podman container inspect --format '{{ .HostConfig.RestartPolicy.Name }}' test-ctr
is "$output" "on-failure" "container inherits from pod"
run_podman create --replace --restart=always --name test-ctr --pod $podname $IMAGE
run_podman container inspect --format '{{ .HostConfig.RestartPolicy.Name }}' test-ctr
is "$output" "always" "container overrides restart policy from pod"
run_podman pod rm -f -a
}
</slice>
[root@kvm-02-guest12 podman]# bats -t -f "podman pod create restart tests" test/system/
1..1
not ok 1 podman pod create restart tests
# (from function `is' in file test/system/helpers.bash, line 866,
# in test file test/system/200-pod.bats, line 687)
# `is "$output" "always" "container overrides restart policy from pod"' failed
# [02:19:37.149952774] # podman rm -t 0 --all --force --ignore
# [02:19:37.255416505] # podman ps --all --external --format {{.ID}} {{.Names}}
# [02:19:37.310543288] # podman images --all --format {{.Repository}}:{{.Tag}} {{.ID}}
# [02:19:37.355657569] # podman image exists quay.io/libpod/testimage:20221018
# [02:19:37.395975899] [ rc=1 ]
# # skopeo copy --preserve-digests docker://quay.io/libpod/testimage:20221018 oci-archive:/tmp/podman-systest-imagecache-0/quay.io--libpod--testimage--20221018.tar
# Getting image source signatures
# Copying blob sha256:578f06cc66c59303d36e0c83b8c7fd9b2da35cca97118700cb4a373677c01dca
# Copying blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
# Copying config sha256:f5a99120db6452661930a1db3bf7390eec9b963f5f62c068fa32dc1d550afad3
# Writing manifest to image destination
# # skopeo copy --all oci-archive:/tmp/podman-systest-imagecache-0/quay.io--libpod--testimage--20221018.tar containers-storage:quay.io/libpod/testimage:20221018
# time="2023-08-23T02:19:38-04:00" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
# Getting image source signatures
# Copying blob sha256:578f06cc66c59303d36e0c83b8c7fd9b2da35cca97118700cb4a373677c01dca
# Copying blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
# Copying config sha256:f5a99120db6452661930a1db3bf7390eec9b963f5f62c068fa32dc1d550afad3
# Writing manifest to image destination
# [02:19:38.605983954] # podman pod create --restart=on-failure --name podZjUV4pXHJG
# [02:19:38.903269323] a3c018df60ce39aae33552f4eb4d0ec3f9027a0c7df682f12edefae90648781d
# [02:19:38.911291383] # podman create --name test-ctr --pod podZjUV4pXHJG quay.io/libpod/testimage:20221018
# [02:19:38.991538534] 996d18b9b15637457b94aa8db85a3326f0587feca8dd8575df1888e26eab126f
# [02:19:39.000063862] # podman container inspect --format {{ .HostConfig.RestartPolicy.Name }} test-ctr
# [02:19:39.055852158] on-failure
# [02:19:39.067963546] # podman create --replace --restart=always --name test-ctr --pod podZjUV4pXHJG quay.io/libpod/testimage:20221018
# [02:19:39.148287490] test-ctr
# f1044b6f604f648ea325a45633cd232900a0271e39ba877f008cbf3cb183bdfe
# [02:19:39.155951951] # podman container inspect --format {{ .HostConfig.RestartPolicy.Name }} test-ctr
# [02:19:39.205315713] on-failure
# #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# #| FAIL: container overrides restart policy from pod
# #| expected: 'always'
# #| actual: 'on-failure'
# #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# [02:19:39.221327849] # podman pod rm -f -t 0 -a
# [02:19:39.301889622] a3c018df60ce39aae33552f4eb4d0ec3f9027a0c7df682f12edefae90648781d
# [02:19:39.304074222] # podman rm -f -t 0 -a
# [02:19:39.384389064] # podman rmi --ignore localhost/podman-pause:4.6.1-1692718337
# [02:19:39.425514179] Untagged: localhost/podman-pause:4.6.1-1692718337
# Deleted: 5b5278f021d484ee9bd10d557a0356de40d3797ee20c0c3ae4023babf3a33ff8
# # [teardown]
# [02:19:39.427578803] # podman pod rm -t 0 --all --force --ignore
# [02:19:39.460059191] # podman rm -t 0 --all --force --ignore
# [02:19:39.492537624] # podman network prune --force
# [02:19:39.527637621] # podman volume rm -a -f
This bug has not been verified on podman-4.6.1-3.module+el8.9.0+19731+94cfa27e. [root@kvm-02-guest12 ~]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.9 Beta (Ootpa) [root@kvm-02-guest12 ~]# rpm -q podman runc systemd kernel podman-4.6.1-3.module+el8.9.0+19731+94cfa27e.x86_64 runc-1.1.9-1.module+el8.9.0+19648+0d5ae0ec.x86_64 systemd-239-77.el8.x86_64 kernel-4.18.0-511.el8.x86_64 [root@kvm-02-guest12 ~]# podman pod create --name test-pod 3cd593b1c7e68b5c6bd95ed49f2ef7a4c10f7470fd43bc57c1fc3cf3d41bda8d [root@kvm-02-guest12 ~]# podman pod ps POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS 3cd593b1c7e6 test-pod Created 4 seconds ago 5b1a5018f151 1 [root@kvm-02-guest12 ~]# podman create --restart=always --pod test-pod docker.io/bash exit 0 Trying to pull docker.io/library/bash:latest... Getting image source signatures Copying blob 5f1191cc3d45 done Copying blob 7264a8db6415 done Copying blob 735bc6fd85d9 done Copying config 3c04497fad done Writing manifest to image destination 07aa652510c96673256cf6fac4d5faaaae00c8cc1e10565de3f9aa6f146ea236 [root@kvm-02-guest12 ~]# podman pod ps POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS 3cd593b1c7e6 test-pod Created 24 seconds ago 5b1a5018f151 2 [root@kvm-02-guest12 ~]# podman pod start test-pod 3cd593b1c7e68b5c6bd95ed49f2ef7a4c10f7470fd43bc57c1fc3cf3d41bda8d [root@kvm-02-guest12 ~]# podman pod ps POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS 3cd593b1c7e6 test-pod Degraded 42 seconds ago 5b1a5018f151 2 [root@kvm-02-guest12 ~]# podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5b1a5018f151 localhost/podman-pause:4.6.1-1692718337 54 seconds ago Up 14 seconds 3cd593b1c7e6-infra 07aa652510c9 docker.io/library/bash:latest exit 0 32 seconds ago Exited (127) 14 seconds ago ecstatic_banzai This bug has not been verified on newest podman-4.6.1-3.module+el8.9.0+19731+94cfa27e, for details, please see Comment 6. This bug has been verified on podman-4.6.1-4.module+el8.9.0+19761+326da906. Closing this bug as Verified state per Comment 16. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: container-tools:rhel8 security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:6939 The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |