Skip to content
Snippets Groups Projects
Unverified Commit d38f33be authored by Varac's avatar Varac
Browse files

Flux: Apply prometheus_alerts_custom_cm.yaml

parent b8ef2acd
No related branches found
No related tags found
No related merge requests found
Showing
with 11 additions and 7 deletions
......@@ -2,18 +2,22 @@ version: 1
commandUpdated:
generators:
# Find all yaml files (recursively).
# Ignore ones with filename starting with a dot. For each of them, check if
# the corresponding settings configmap has disabled the app by having a key
# "enabled" with value "false", and skip it in that case.
# Filename convention: appname_optional_additional_identifiers_resourcetype.yaml
# i.e. oas/prometheus_alerts_custom_cm.yaml (configmap)
# Ignore ones with filename starting with a dot.
# For each file, check if the corresponding app settings configmap has
# disabled the app by having a key "enabled" with value "false", and skip
# it in that case.
# Otherwise, include it.
- command: >
for namespace in *; do
for path in $(find "$namespace" -type f \( -name '*.yaml' -o -name '*.yml' \) -a ! -name '.*'); do
filename=$(basename $path);
name="${filename%.*}";
for location in $(find "$namespace" -type f \( -name '*.yaml' -o -name '*.yml' \) -a ! -name '.*'); do
filename=$(basename $location);
name="${filename%%_*}";
enabled=$(kubectl get secret -n "$namespace" "${name}-settings" -o jsonpath="{.data.enabled}" | base64 -d);
if [ "$enabled" == "true" ]; then
echo '---';
cat $path;
cat $location;
fi;
done;
done
......
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment