@@ -371,29 +371,21 @@ versionstring="$(get_helm_versionstring "$KUBE_PROM_STACK_CHART_VERSION")"
371
371
log_debug " Installing Helm chart from artifact [$chart2install ]"
372
372
373
373
# 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/ "
376
376
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 " )
389
381
390
382
# Run the kubectl command with all arguments
391
383
kubectl create configmap grafana-alert-rules \
392
384
" ${CM_ARGS[@]} " \
393
385
-n " $MON_NS " \
394
386
--dry-run=client -o yaml | kubectl apply -f -
395
387
else
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. "
397
389
fi
398
390
399
391
# shellcheck disable=SC2086
0 commit comments