File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments