@@ -371,29 +371,21 @@ versionstring="$(get_helm_versionstring "$KUBE_PROM_STACK_CHART_VERSION")"
371371log_debug " Installing Helm chart from artifact [$chart2install ]"
372372
373373# Alerts
374- if [ -d " monitoring/alerting/ rules" ] ; then
375- log_verbose " Creating Grafana alert rules ConfigMap "
374+ log_verbose " Creating Grafana alert rules ConfigMap "
375+ CUSTOM_ALERT_CONFIG_DIR= " $USER_DIR /monitoring/alerting/ "
376376
377- # Start with required file
378- CM_ARGS=(--from-file=" monitoring/alerting/rules" )
379-
380- CUSTOM_ALERT_CONFIG_DIR=" $USER_DIR /monitoring/alerting/"
381-
382- # Add optional custom directory if it exists
383- if [ -d " $CUSTOM_ALERT_CONFIG_DIR " ]; then
384- log_debug " Including notifiers and additional alert rules from '$CUSTOM_ALERT_CONFIG_DIR '"
385- CM_ARGS+=(--from-file=" $CUSTOM_ALERT_CONFIG_DIR " )
386- else
387- log_debug " No custom alert config directory found at '$CUSTOM_ALERT_CONFIG_DIR '. Skipping."
388- fi
377+ # Add optional custom directory if it exists
378+ if [ -d " $CUSTOM_ALERT_CONFIG_DIR " ]; then
379+ log_debug " Including notifiers and additional alert rules from '$CUSTOM_ALERT_CONFIG_DIR '"
380+ CM_ARGS=(--from-file=" $CUSTOM_ALERT_CONFIG_DIR " )
389381
390382 # Run the kubectl command with all arguments
391383 kubectl create configmap grafana-alert-rules \
392384 " ${CM_ARGS[@]} " \
393385 -n " $MON_NS " \
394386 --dry-run=client -o yaml | kubectl apply -f -
395387else
396- log_debug " No alert rules file found at 'monitoring/alerting/rules' "
388+ log_debug " No custom alert config directory found at '$CUSTOM_ALERT_CONFIG_DIR '. Skipping. "
397389fi
398390
399391# shellcheck disable=SC2086
0 commit comments