Skip to content

Commit

Permalink
bootstrap: pull MCD image, copy machine-config-daemon binary and run …
Browse files Browse the repository at this point in the history
…pivot before proceeding
  • Loading branch information
vrutkovs committed Oct 23, 2019
1 parent 456e4c3 commit c7da474
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions data/data/bootstrap/files/usr/local/bin/bootkube.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ MDNS_PUBLISHER_IMAGE=$(image_for mdns-publisher)
HAPROXY_IMAGE=$(image_for haproxy-router)
BAREMETAL_RUNTIMECFG_IMAGE=$(image_for baremetal-runtimecfg)

# Copy machine-config-daemon binary from payload and run pivot
if [ ! -f .pivot-done ]; then
mkdir /run/pivot /etc/pivot
touch /run/pivot/reboot-needed
echo "${MACHINE_CONFIG_OSCONTENT}" > /etc/pivot/image-pullspec

mkdir bin/
bootkube_podman_run \
--volume "$PWD/bin:/host/usr/local/bin:z" \
--entrypoint=sh \
"${MACHINE_CONFIG_OPERATOR_IMAGE}" \
-c "cp /usr/bin/machine-config-daemon /host/usr/local/bin"

touch .pivot-done
./bin/machine-config-daemon pivot
fi

# Now, as early as possible we replace the pause image and reload crio to use it, to ensure
# that we're using the pause image from our payload just like the primary cluster.
# The config should match the one generated by the MCO ideally:
Expand Down

0 comments on commit c7da474

Please sign in to comment.