Files
Factory/baremetal-operator-image/bmo-run
Nicolas Belouin 4fab8da5d5 Add bmo inotify hook
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
(cherry picked from commit c190a1c800)
2025-06-03 15:07:22 +02:00

12 lines
465 B
Bash

#!/bin/bash
export RESTART_CONTAINER_CERTIFICATE_UPDATED=${RESTART_CONTAINER_CERTIFICATE_UPDATED:-"false"}
export IRONIC_CACERT_FILE=${IRONIC_CACERT_FILE:-"/opt/metal3/certs/ca/tls.crt"}
if [[ "${RESTART_CONTAINER_CERTIFICATE_UPDATED}" == "true" ]]; then
# shellcheck disable=SC2034
inotifywait -m -e delete_self "${IRONIC_CACERT_FILE}" | while read -r file event; do
kill $(pgrep baremetal-opera)
done &
fi
exec /usr/bin/baremetal-operator $@