From 4456bde1c820c2c5cbda1054e1398c010fed375b Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Tue, 16 Jun 2026 10:45:53 -0500 Subject: [PATCH] check if template exists without --fail flag --- salt/manager/tools/sbin/soup | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 668d7d1de..12be85eaf 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -783,10 +783,16 @@ pin_elasticsearch_data_retention_method() { # # Reference: https://github.com/elastic/kibana/issues/263048 kibana_backport_streams_index_template() { - local current_template updated_template + local current_template updated_template current_template_exists + + current_template_exists=$(so-elasticsearch-query "_index_template/.kibana_streams" -o /dev/null -w "%{http_code}") + if [[ "$current_template_exists" == "404" ]]; then + echo "Index template .kibana_streams does not exist, skipping backport." + return 0 + fi if ! current_template=$(so-elasticsearch-query "_index_template/.kibana_streams" --retry 3 --retry-delay 5 --fail); then - echo "Index template .kibana_streams does not exist, skipping backport." + echo "Unable to retrieve .kibana_streams index template, skipping backport." return 0 fi