initial acm config

This commit is contained in:
2025-05-19 11:18:25 -05:00
parent caea2573e8
commit 631aa6f626
486 changed files with 106 additions and 11791 deletions

View File

@@ -0,0 +1,28 @@
#!/bin/sh
NAMESPACE=$1
STATE=$2
MAIN_CLUSTERGROUP_FILE="./values-$(common/scripts/determine-main-clustergroup.sh).yaml"
MAIN_CLUSTERGROUP_PROJECT="$(common/scripts/determine-main-clustergroup.sh)"
case "$STATE" in
"present")
RES=$(yq ".clusterGroup.namespaces[] | select(. == \"$NAMESPACE\")" "$MAIN_CLUSTERGROUP_FILE" 2>/dev/null)
if [ -z "$RES" ]; then
echo "Namespace $NAMESPACE not found, adding"
yq -i ".clusterGroup.namespaces += [ \"$NAMESPACE\" ]" "$MAIN_CLUSTERGROUP_FILE"
fi
;;
"absent")
echo "Removing namespace $NAMESPACE"
yq -i "del(.clusterGroup.namespaces[] | select(. == \"$NAMESPACE\"))" "$MAIN_CLUSTERGROUP_FILE"
;;
*)
echo "$STATE not supported"
exit 1
;;
esac
exit 0