From c8d4ff66d69a288e65d72f789db40422815a1030 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 a2fe578870b..a784bd10321 100755 --- a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template +++ b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template @@ -201,6 +201,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..."