File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 8787TMP_RENDERED=" $( mktemp -d) "
8888echo " Rendering manifests to $TMP_RENDERED ..."
8989tk export " $TMP_RENDERED /" " $TANKA_REPO_DIR /environments" -r -l " $( join_arr , " ${SELECTOR[@]} " ) " --format=" $TANKA_EXPORT_FMT " --merge-strategy=fail-on-conflicts
90+
91+ # Filter out GrafanaDashboard CRs from non-monitoring clusters
92+ # Dashboards should only be deployed to aws.dev.monitoring and aws.logs
93+ echo " Filtering GrafanaDashboard manifests from non-monitoring clusters..."
94+ while IFS= read -r -d ' ' manifest; do
95+ # Extract the environment name (e.g., aws.dev, aws.prod) from the path
96+ # Path format: $TMP_RENDERED/environments/<app>/<env>/manifests/<file>.yaml
97+ env_name=$( echo " $manifest " | sed -E ' s|.*/environments/[^/]+/([^/]+)/manifests/.*|\1|' )
98+ if [[ " $env_name " != " aws.dev.monitoring" && " $env_name " != " aws.logs" ]]; then
99+ rm -f " $manifest "
100+ fi
101+ done < <( find " $TMP_RENDERED " -name " *GrafanaDashboard*.yaml" -print0 2> /dev/null)
90102function finish {
91103 rm -rf " $TMP_RENDERED "
92104}
You can’t perform that action at this time.
0 commit comments