Skip to content

Commit

Permalink
Change bootstrap host to replace itself with machine-os-content too
Browse files Browse the repository at this point in the history
Currently every machine instance we launch uses the same "bootimage", 
including the bootstrap host. However, everything except bootstrap (i.e. 
control plane and workers) replace their OS content with the 
machine-os-content from the release payload before joining the cluster.

For more information, see: 
https://github.com/openshift/machine-config-operator/blob/master/docs/OSUpgrades.md

This changes the bootstrap host to do the same, which will help avoid 
issues from "bootimage drift".

Closes: #2542
  • Loading branch information
vrutkovs committed Oct 24, 2019
1 parent 88f78ac commit a661f2e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 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 @@ -37,6 +37,21 @@ 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

hostmcd=/usr/local/bin/machine-config-daemon
bootkube_podman_run --entrypoint=sh "${MACHINE_CONFIG_OPERATOR_IMAGE}" \
cat /usr/bin/machine-config-daemon > ${hostmcd}
chmod a+x ${hostmcd}
restorecon ${hostmcd}
touch .pivot-done
${hostmcd} pivot
fi

mkdir --parents ./{bootstrap-manifests,manifests}

if [ ! -f openshift-manifests.done ]
Expand Down

0 comments on commit a661f2e

Please sign in to comment.