diff --git a/packaging/bootc.Containerfile b/packaging/bootc.Containerfile index fab3ebe0..60277732 100644 --- a/packaging/bootc.Containerfile +++ b/packaging/bootc.Containerfile @@ -39,6 +39,10 @@ RUN ${REPO_CONFIG_SCRIPT} -create ${USHIFT_RPM_REPO_PATH} && \ rm -rvf ${USHIFT_RPM_REPO_PATH} && \ dnf clean all +# Pin the greenboot package to 0.15.z until the following issue is resolved: +# https://github.com/fedora-iot/greenboot-rs/issues/132 +RUN dnf install -y 'greenboot-0.15.*' && dnf clean all + # Post-install MicroShift configuration COPY --chmod=755 ./src/rpm/postinstall.sh ${USHIFT_POSTINSTALL_SCRIPT} RUN ${USHIFT_POSTINSTALL_SCRIPT} && rm -vf "${USHIFT_POSTINSTALL_SCRIPT}" diff --git a/src/cluster_manager.sh b/src/cluster_manager.sh index 314c0746..915b0995 100755 --- a/src/cluster_manager.sh +++ b/src/cluster_manager.sh @@ -122,6 +122,7 @@ _add_node() { mount_opts="--volume ${EXTRA_CONFIG}:/etc/microshift/config.d/api_server.yaml:ro" fi + local rc=0 # shellcheck disable=SC2086 sudo podman run --privileged -d \ --ulimit nofile=524288:524288 \ @@ -134,7 +135,26 @@ _add_node() { --hostname "${name}" \ "${USHIFT_IMAGE}" - return $? + rc=$? + if [ $rc -ne 0 ]; then + return $rc + fi + + # Wait up to 60 seconds for the container to activate the dbus service. + # It is necessary to prevent subsequent systemctl commands to fail with dbus errors. + local is_active=false + for _ in {1..60}; do + if sudo podman exec -i "${name}" systemctl is-active -q dbus.service ; then + is_active=true + break + fi + sleep 1 + done + if [ "${is_active}" = "false" ]; then + echo "ERROR: The container did not activate the dbus service within 60 seconds" + return 1 + fi + return 0 } diff --git a/src/quickrpm.sh b/src/quickrpm.sh index 55952233..e06ec819 100755 --- a/src/quickrpm.sh +++ b/src/quickrpm.sh @@ -79,6 +79,10 @@ function install_rpms() { dnf install -y --setopt=install_weak_deps=False \ microshift microshift-kindnet microshift-topolvm "${WORKDIR}/create_repos.sh" -delete + + # Pin the greenboot package to 0.15.z until the following issue is resolved: + # https://github.com/fedora-iot/greenboot-rs/issues/132 + dnf install -y 'greenboot-0.15.*' } function prepare_lvm_disk() {