Skip to content

Commit 3fe2a3c

Browse files
authored
Merge pull request #9863 from afbjorklund/kicbase-201106
Upgrade kicbase to ubuntu:focal-20201106
2 parents 268a938 + 756836d commit 3fe2a3c

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

deploy/kicbase/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# start from ubuntu 20.04, this image is reasonably small as a starting point
2121
# for a kubernetes node image, it doesn't contain much we don't need
22-
FROM ubuntu:focal-20200925
22+
FROM ubuntu:focal-20201106
2323

2424
ARG BUILDKIT_VERSION="v0.7.2"
2525

deploy/kicbase/entrypoint

+17-16
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ set -o nounset
1919
set -o pipefail
2020
set -x
2121

22+
configure_proxy() {
23+
# ensure all processes receive the proxy settings by default
24+
# https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html
25+
mkdir -p /etc/systemd/system.conf.d/
26+
cat <<EOF >/etc/systemd/system.conf.d/proxy-default-environment.conf
27+
[Manager]
28+
DefaultEnvironment="HTTP_PROXY=${HTTP_PROXY:-}" "HTTPS_PROXY=${HTTPS_PROXY:-}" "NO_PROXY=${NO_PROXY:-}"
29+
EOF
30+
}
31+
2232
update-alternatives() {
2333
echo "retryable update-alternatives: $*"
2434
local args=$*
@@ -48,7 +58,7 @@ fix_mount() {
4858
# This is a workaround to an AUFS bug that might cause `Text file
4959
# busy` on `mount` command below. See more details in
5060
# https://github.com/moby/moby/issues/9547
51-
if [[ "$(stat -f -c %T /bin/mount)" == 'aufs' ]]; then
61+
if [[ "$(stat -f -c %T "$(which mount)")" == 'aufs' ]]; then
5262
echo 'INFO: detected aufs, calling sync' >&2
5363
sync
5464
fi
@@ -174,16 +184,6 @@ fix_kmsg() {
174184
fi
175185
}
176186

177-
configure_proxy() {
178-
# ensure all processes receive the proxy settings by default
179-
# https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html
180-
mkdir -p /etc/systemd/system.conf.d/
181-
cat <<EOF >/etc/systemd/system.conf.d/proxy-default-environment.conf
182-
[Manager]
183-
DefaultEnvironment="HTTP_PROXY=${HTTP_PROXY:-}" "HTTPS_PROXY=${HTTPS_PROXY:-}" "NO_PROXY=${NO_PROXY:-}"
184-
EOF
185-
}
186-
187187
select_iptables() {
188188
# based on: https://github.com/kubernetes/kubernetes/blob/ffe93b3979486feb41a0f85191bdd189cbd56ccc/build/debian-iptables/iptables-wrapper
189189
local mode=nft
@@ -229,7 +229,7 @@ enable_network_magic(){
229229
sed -e "s/${docker_embedded_dns_ip}/${docker_host_ip}/g" /etc/resolv.conf.original >/etc/resolv.conf
230230

231231
# fixup IPs in manifests ...
232-
curr_ipv4="$( (getent ahostsv4 $(hostname) | head -n1 | cut -d' ' -f1) || true)"
232+
curr_ipv4="$( (getent ahostsv4 "$(hostname)" | head -n1 | cut -d' ' -f1) || true)"
233233
echo "INFO: Detected IPv4 address: ${curr_ipv4}" >&2
234234
if [ -f /kind/old-ipv4 ]; then
235235
old_ipv4=$(cat /kind/old-ipv4)
@@ -249,7 +249,7 @@ enable_network_magic(){
249249
fi
250250

251251
# do IPv6
252-
curr_ipv6="$( (getent ahostsv6 $(hostname) | head -n1 | cut -d' ' -f1) || true)"
252+
curr_ipv6="$( (getent ahostsv6 "$(hostname)" | head -n1 | cut -d' ' -f1) || true)"
253253
echo "INFO: Detected IPv6 address: ${curr_ipv6}" >&2
254254
if [ -f /kind/old-ipv6 ]; then
255255
old_ipv6=$(cat /kind/old-ipv6)
@@ -269,15 +269,16 @@ enable_network_magic(){
269269
}
270270

271271
# run pre-init fixups
272-
select_iptables
272+
# NOTE: it's important that we do configure* first in this order to avoid races
273+
configure_proxy
273274
fix_kmsg
274275
fix_mount
275276
retryable_fix_cgroup_mounts
276277
fix_machine_id
277278
fix_product_name
278279
fix_product_uuid
279-
configure_proxy
280+
select_iptables
280281
enable_network_magic
281282

282283
# we want the command (expected to be systemd) to be PID1, so exec to it
283-
exec "$@"
284+
exec "$@"

0 commit comments

Comments
 (0)