Files
utilities/tools/nocloud-factory-install/factory-install/setup/10-system-setup
Enzo Candotti f13b13f2d4 Wait for rook-ceph to be applied in factory backup stage
If rook-ceph is configured in a standalone system, during a factory
install the backup script fails when it tries to create the ceph
backup, since the rook-ceph application is not yet applied.

This commit updates the 10-system-backup script to wait for the
rook-ceph application to reach the "applied" state before running the
backup.

When rook-ceph is configured, this check adds between 7 to 11 minutes
to the factory-install process, depending on how long rook-ceph takes
to reach the applied state.

Test Plan:
PASS: Run a factory-install in a standalone host with rook-ceph
configured. Verify that the setup backup waits until the app is applied
and the factory-install completes successfully.
PASS: Run a factory-install in a standalone host without rook-ceph
configured. Verify that the backup stage does not wait for the app.

Closes-bug: 2125236

Change-Id: I67b18426b1acc3f3389f2aae71a93b7bb0a66175
Signed-off-by: Enzo Candotti <Enzo.Candotti@windriver.com>
2025-09-23 17:59:28 -03:00

41 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Factory install system setup triggered during the setup stage
#
echo "System Setup - Start"
echo "Wait - host goenabled"
until [ -f /var/run/goenabled ]; do
sleep 10
done
echo "Ready - host goenabled"
system_mode=$(awk -F= '/system_mode/ {print $2}' /etc/platform/platform.conf)
echo "Wait - system deployment reconciled"
while true; do
if [ "$system_mode" = "duplex" ]; then
SYSTEM_RECONCILED=true
else
SYSTEM_RECONCILED=$(kubectl --kubeconfig=/etc/kubernetes/admin.conf -n deployment get system -o jsonpath='{.items[0].status.reconciled}')
fi
HOST_RECONCILED=$(kubectl --kubeconfig=/etc/kubernetes/admin.conf -n deployment get host controller-0 -o jsonpath='{.status.reconciled}')
if [ "$SYSTEM_RECONCILED" = true ] && [ "$HOST_RECONCILED" = true ]; then
break
fi
echo "Not ready - rechecking in 10s..."
sleep 10
done
echo "Ready - system deployment reconciled"
echo "System Setup - Complete"
exit 0