From 477a20d701230470604b045f4e805e98cfb50765 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 4 Feb 2019 21:15:17 +0000 Subject: [PATCH] bootkube: Inject bootstrap MachineConfigs into cluster This is an ugly fix for https://github.com/openshift/machine-config-operator/issues/367 --- .../bootstrap/files/usr/local/bin/bootkube.sh.template | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template index a8f536325bb..573e97a82f8 100755 --- a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template +++ b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template @@ -314,6 +314,15 @@ echo "etcd cluster up. Killing etcd certificate signer..." podman rm --force etcd-signer rm --force /etc/kubernetes/manifests/machineconfigoperator-bootstrap-pod.yaml +# Copy the bootstrap MCs to inject into the target cluster +# Yes this is a brutal hack, need to improve the MCC bootstrap above +# 9a so we're after 99 - should change the others to 50- or something? +for x in /etc/mcs/bootstrap/machine-configs/*.yaml; do + bn=$(basename $x) + (echo 'apiVersion: machineconfiguration.openshift.io/v1' + echo 'kind: MachineConfig' + python -c 'import sys,yaml; d=yaml.load(open(sys.argv[1])); del d["metadata"]["ownerReferences"]; yaml.dump(d, sys.stdout)' $x) > /opt/openshift/openshift/9a-${bn} +done echo "Starting cluster-bootstrap..."