@@ -84,7 +84,7 @@ run_case() {
8484 if [[ -n " $must_have " ]]; then
8585 IFS=' ,' read -ra fragments <<< " $must_have"
8686 for f in " ${fragments[@]} " ; do
87- if ! grep -q " $f " <<< " $output" ; then
87+ if ! grep -qF -- " $f " <<< " $output" ; then
8888 echo -e " ${R} FAIL${N} : missing required fragment: $f "
8989 local_fail=1
9090 fi
@@ -94,7 +94,7 @@ run_case() {
9494 if [[ -n " $must_not " ]]; then
9595 IFS=' ,' read -ra fragments <<< " $must_not"
9696 for f in " ${fragments[@]} " ; do
97- if grep -q " $f " <<< " $output" ; then
97+ if grep -qF -- " $f " <<< " $output" ; then
9898 echo -e " ${R} FAIL${N} : forbidden fragment present: $f "
9999 local_fail=1
100100 fi
@@ -109,22 +109,23 @@ run_case() {
109109 fi
110110}
111111
112- # Fragment shortcuts used across states.
113- METRICS_EXPORTER=" otlphttp/cw_k8s_ci_v0_metrics_dest"
114- METRICS_SIGV4=" sigv4auth/cw_k8s_ci_v0_metrics_dest"
115- LOG_EXPORTER_APP=" otlphttp/cw_k8s_ci_v0_app_logs_dest"
116- LOG_EXPORTER_NODE=" otlphttp/cw_k8s_ci_v0_node_logs_dest"
117- LOG_SIGV4=" sigv4auth/cw_k8s_ci_v0_logs_dest"
118- LOG_PIPELINE_APP=" logs/cw_k8s_ci_v0_app"
119- FILELOG_APP=" filelog/cw_k8s_ci_v0_app"
112+ # OTEL CI is delivered via the agent's JSON config
113+ # (opentelemetry.collect.container_insights); the agent generates the OTEL
114+ # pipeline at runtime, so we assert on the escaped JSON in the CR `config:`
115+ # field rather than on rendered collector fragments.
116+ OTEL_CI=' collect\":{\"container_insights'
117+ OTEL_CI_NODE=' \"role\":\"node\"'
118+ OTEL_CI_CLUSTER=' \"role\":\"cluster\"'
119+ OTEL_CI_LOGS_ON=' \"logs\":{\"enabled\":true}'
120+ OTEL_CI_LOGS_OFF=' \"logs\":{\"enabled\":false}'
120121# aws-for-fluent-bit is the container image string — unique to the FluentBit
121122# DaemonSet. Using this instead of bare "fluent-bit" avoids false matches in
122123# OTEL config paths like /var/log/containers/fluent-bit* (which exist in the
123124# filelog exclude list regardless of the FB DaemonSet flag).
124125FLUENT_BIT_IMAGE=" aws-for-fluent-bit"
125126
126- # All OTEL log pipeline fragments (app + host) .
127- ALL_LOG_FRAGMENTS =" $LOG_EXPORTER_APP , $LOG_EXPORTER_NODE , $LOG_SIGV4 , $LOG_PIPELINE_APP , $FILELOG_APP "
127+ # Both node (daemonset) and cluster (scraper) CI config present .
128+ OTEL_CI_BOTH_ROLES =" $OTEL_CI , $OTEL_CI_NODE , $OTEL_CI_CLUSTER "
128129
129130# ──────────────────────────────────────────────────────────────────────────
130131# Run all 8 combinations.
@@ -136,43 +137,43 @@ echo "Chart: $CHART_DIR"
136137# State #1: all false — no monitoring.
137138run_case 1 false false false " ok" \
138139 " No monitoring — all flags off" \
139- " " " $METRICS_EXPORTER ,$FLUENT_BIT_IMAGE "
140+ " " " $OTEL_CI ,$FLUENT_BIT_IMAGE "
140141
141142# State #2: FluentBit only (pure v1 legacy).
142143run_case 2 false false true " ok" \
143144 " FluentBit legacy only" \
144- " $FLUENT_BIT_IMAGE " " $METRICS_EXPORTER , $ALL_LOG_FRAGMENTS "
145+ " $FLUENT_BIT_IMAGE " " $OTEL_CI "
145146
146147# State #3: logs=true without enabled — silently ignored.
147148run_case 3 false true false " ok" \
148149 " logs=true without enabled — no OTEL output" \
149- " " " $METRICS_EXPORTER , $ALL_LOG_FRAGMENTS ,$FLUENT_BIT_IMAGE "
150+ " " " $OTEL_CI ,$FLUENT_BIT_IMAGE "
150151
151152# State #4: same as #3 with FluentBit.
152153run_case 4 false true true " ok" \
153154 " logs=true without enabled + FluentBit — only FluentBit" \
154- " $FLUENT_BIT_IMAGE " " $METRICS_EXPORTER , $ALL_LOG_FRAGMENTS "
155+ " $FLUENT_BIT_IMAGE " " $OTEL_CI "
155156
156- # State #5: OTEL metrics only.
157+ # State #5: OTEL metrics only (logs disabled) .
157158run_case 5 true false false " ok" \
158159 " OTEL metrics only, no logs" \
159- " $METRICS_EXPORTER , $METRICS_SIGV4 " " $ALL_LOG_FRAGMENTS ,$FLUENT_BIT_IMAGE "
160+ " $OTEL_CI_BOTH_ROLES , $OTEL_CI_LOGS_OFF " " $OTEL_CI_LOGS_ON ,$FLUENT_BIT_IMAGE "
160161
161162# State #6: hybrid — OTEL metrics + FluentBit logs.
162163run_case 6 true false true " ok" \
163164 " Hybrid — OTEL metrics + FluentBit logs" \
164- " $METRICS_EXPORTER , $METRICS_SIGV4 ,$FLUENT_BIT_IMAGE " " $ALL_LOG_FRAGMENTS "
165+ " $OTEL_CI_BOTH_ROLES , $OTEL_CI_LOGS_OFF ,$FLUENT_BIT_IMAGE " " $OTEL_CI_LOGS_ON "
165166
166167# State #7: full OTEL (metrics + logs, no FluentBit).
167168run_case 7 true true false " ok" \
168169 " Full OTEL (metrics + logs)" \
169- " $METRICS_EXPORTER , $METRICS_SIGV4 , $LOG_EXPORTER_APP , $LOG_EXPORTER_NODE , $LOG_SIGV4 , $FILELOG_APP " \
170+ " $OTEL_CI_BOTH_ROLES , $OTEL_CI_LOGS_ON " \
170171 " $FLUENT_BIT_IMAGE "
171172
172173# State #8: dual-publish (migration window — OTEL logs + FluentBit both active).
173174run_case 8 true true true " ok" \
174175 " Dual-publish — OTEL logs + FluentBit both active" \
175- " $METRICS_EXPORTER , $LOG_EXPORTER_APP , $LOG_EXPORTER_NODE , $FILELOG_APP ,$FLUENT_BIT_IMAGE " \
176+ " $OTEL_CI_BOTH_ROLES , $OTEL_CI_LOGS_ON ,$FLUENT_BIT_IMAGE " \
176177 " "
177178
178179# ──────────────────────────────────────────────────────────────────────────
0 commit comments