Skip to content

Commit

Permalink
bootkube.sh: pivot bootstrap node for OKD installs
Browse files Browse the repository at this point in the history
OKD is using plain FCOS, which doesn't have MCD binary to pivot.
It should extract it from machine-config-daemon image and run pivot manually.
This also extract necessary files and manifests from machine-os-content image
  • Loading branch information
vrutkovs committed Dec 10, 2020
1 parent 230a866 commit 2a159c2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Expand Up @@ -17,3 +17,20 @@ do
echo "Pull failed. Retrying $RELEASE_IMAGE..."
done

{{if .IsOKD -}}
# Pivot bootstrap to FCOS + OKD machine-os-content
if [ ! -f /opt/openshift/.pivot-done ]; then
. /usr/local/bin/release-image.sh

# Run pre-pivot.sh script to update bootstrap node
MACHINE_CONFIG_OSCONTENT=$(image_for machine-os-content)
while ! podman pull --quiet "$MACHINE_CONFIG_OSCONTENT"
do
echo "Pull failed. Retrying $MACHINE_CONFIG_OSCONTENT..."
done
mnt=$(podman image mount "${MACHINE_CONFIG_OSCONTENT}")
pushd ${mnt}/bootstrap
. ./pre-pivot.sh
popd
fi
{{end -}}
2 changes: 2 additions & 0 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Expand Up @@ -59,6 +59,7 @@ type bootstrapTemplateData struct {
Registries []sysregistriesv2.Registry
BootImage string
PlatformData platformTemplateData
IsOKD bool
}

// platformTemplateData is the data to use to replace values in bootstrap
Expand Down Expand Up @@ -278,6 +279,7 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig, releaseI
BootImage: string(*rhcosImage),
PlatformData: platformData,
ClusterProfile: clusterProfile,
IsOKD: installConfig.IsOKD(),
}, nil
}

Expand Down

0 comments on commit 2a159c2

Please sign in to comment.