Skip to content

Commit f7ed2c2

Browse files
committed
Fix proxy always enabled even without allowed-images config
The ExecStartPre condition `if $ALLOWED_IMAGES` expands to bare `if` when the variable is unset, which succeeds unconditionally. Docker and containerd then start with HTTPS_PROXY=http://127.0.0.1:3128 even when OpenResty is not installed, breaking all image pulls. Test for the config file the comment already describes instead. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
1 parent 7c5782b commit f7ed2c2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

root/usr/local/lib/systemd/system/containerd.service.d/allowed-images.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
EnvironmentFile=-/etc/sysconfig/allowed-images.env
55
ExecStartPre=/bin/sh -c '\
66
set -x ; \
7-
if $ALLOWED_IMAGES ; then \
7+
if [ -f /usr/local/openresty/nginx/conf/allowed-images.conf ] ; then \
88
echo HTTPS_PROXY=http://127.0.0.1:3128 > /etc/sysconfig/allowed-images.env ; \
99
else \
1010
rm -f /etc/sysconfig/allowed-images.env ; \

root/usr/local/lib/systemd/system/docker.service.d/allowed-images.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
EnvironmentFile=-/etc/sysconfig/allowed-images.env
55
ExecStartPre=/bin/sh -c '\
66
set -x ; \
7-
if $ALLOWED_IMAGES ; then \
7+
if [ -f /usr/local/openresty/nginx/conf/allowed-images.conf ] ; then \
88
echo HTTPS_PROXY=http://127.0.0.1:3128 > /etc/sysconfig/allowed-images.env ; \
99
else \
1010
rm -f /etc/sysconfig/allowed-images.env ; \

0 commit comments

Comments
 (0)