Skip to content

Commit

Permalink
[DNM][DRAFT] Agent-based Installer test for OKD/FCOS
Browse files Browse the repository at this point in the history
  • Loading branch information
JM1 committed Sep 14, 2023
1 parent 3d95de8 commit e1d36fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{if .IsOKD -}}
#!/usr/bin/env bash
set -euo pipefail
set -x

# Exit early if pivot is attempted on SCOS Live ISO
{{if .IsSCOS -}}
Expand Down Expand Up @@ -42,25 +43,20 @@ if [ ! -f /opt/openshift/.pivot-done ]; then
record_service_stage_start "rebase-to-okd-os-image"
{{if .IsFCOS -}}
mnt="$(podman image mount "${MACHINE_OS_IMAGE}")"
{{- if .BootstrapInPlace }}
# SNO setup boots into Live ISO which cannot be rebased
# https://github.com/coreos/rpm-ostree/issues/4547
podman volume create machine-os-image
machine_os_image=$(podman volume inspect machine-os-image --format '{{`{{ .Mountpoint }}`}}')
rsync -aHAXx "$mnt/" "$machine_os_image/"

mkdir /var/mnt/{upper,worker}
mount -t overlay overlay -o "lowerdir=/usr:$mnt/usr" /usr
mount -t overlay overlay -o "lowerdir=/etc:$mnt/etc,upperdir=/var/mnt/upper,workdir=/var/mnt/worker" /etc
mount -t overlay overlay -o "lowerdir=/usr:$machine_os_image/usr" /usr
rsync -rlt --ignore-existing "$machine_os_image/etc/" /etc/
systemctl daemon-reload

# Workaround for SELinux denials when launching crio.service from overlayfs
setenforce Permissive

systemctl start crio.service
# No reboot necessary because SNO setup will reboot system
{{ else }}
pushd "${mnt}/bootstrap"
# shellcheck disable=SC1091
. ./pre-pivot.sh
popd
{{ end -}}
{{else if .IsSCOS -}}
chmod 0644 /etc/containers/registries.conf
rpm-ostree rebase --experimental "ostree-unverified-registry:${MACHINE_OS_IMAGE}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
Description=Pivot bootstrap to the OpenShift Release Image
Wants=release-image.service
After=release-image.service
{{- if .BootstrapInPlace }}
Before=bootkube.service kubelet.service
{{ else }}
Before=bootkube.service
{{ end -}}

[Service]
Type=oneshot
Expand Down

0 comments on commit e1d36fb

Please sign in to comment.