Skip to content

Commit e10356b

Browse files
committed
fix(test-suite): preserve coprocessor OTLP endpoint across local env regen
1 parent ce534fe commit e10356b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test-suite/fhevm/scripts/deploy-fhevm-stack.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ prepare_local_env_file() {
356356
local component=$1
357357
local base_env_file="$SCRIPT_DIR/../env/staging/.env.$component"
358358
local local_env_file="$SCRIPT_DIR/../env/staging/.env.$component.local"
359+
local preserved_otlp_endpoint=""
360+
361+
# Keep locally overridden OTLP endpoint across deploy regenerations.
362+
if [[ "$component" == "coprocessor" && -f "$local_env_file" ]]; then
363+
preserved_otlp_endpoint=$(awk -F= '$1 == "OTEL_EXPORTER_OTLP_ENDPOINT" {print substr($0, index($0, "=") + 1); exit}' "$local_env_file")
364+
fi
359365

360366
if [[ ! -f "$base_env_file" ]]; then
361367
echo -e "${RED}[ERROR]${NC} Base environment file for $component not found: $base_env_file" >&2
@@ -365,6 +371,15 @@ prepare_local_env_file() {
365371
cp "$base_env_file" "$local_env_file"
366372
fi
367373

374+
if [[ "$component" == "coprocessor" ]]; then
375+
local otlp_endpoint="${preserved_otlp_endpoint:-http://jaeger:4317}"
376+
if grep -q '^OTEL_EXPORTER_OTLP_ENDPOINT=' "$local_env_file"; then
377+
sed -i.bak "s|^OTEL_EXPORTER_OTLP_ENDPOINT=.*|OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint}|" "$local_env_file"
378+
else
379+
printf '\nOTEL_EXPORTER_OTLP_ENDPOINT=%s\n' "$otlp_endpoint" >> "$local_env_file"
380+
fi
381+
fi
382+
368383
printf "%s" "$local_env_file"
369384
}
370385

0 commit comments

Comments
 (0)