From 5b092de10ad9645ad11d2e29fa46e2558ba21f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Ciecierski?= Date: Thu, 14 May 2026 13:37:48 +0200 Subject: [PATCH] Inform developer how to restore OLM CSV on cleanup Print a message in the cleanup handler with the exact `oc patch` command needed to restore the operator's original CSV after the local webhook run exits. --- hack/run_with_local_webhook.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hack/run_with_local_webhook.sh b/hack/run_with_local_webhook.sh index 68f2941930..a8a9c31115 100755 --- a/hack/run_with_local_webhook.sh +++ b/hack/run_with_local_webhook.sh @@ -5,6 +5,13 @@ set -ex cleanup() { echo "Caught signal, cleaning up local webhooks..." ./hack/clean_local_webhook.sh + # Remind the user how to restore the CSV since the earlier message + # may have scrolled off the terminal. + if [ -n "${CSV_FILE}" ]; then + printf \ + "\n\tThe original OLM version of the operator's CSV has been copied to %s. To restore it, use: + oc patch -n openstack-operators %s --type=merge --patch-file=%s\n\n" "${CSV_FILE}" "${CSV_NAME}" "${CSV_FILE}" + fi exit 0 }