fix: load telemetry and WAF modules in bootstrap config (#5818) #5858
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.62) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 242 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.329
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #5858"
general
weight: 0.35
devaniketh
Proposed Changes
Closes #5818
When an NGF data-plane pod is re-initialized (e.g., following a node or runtime disruption where
emptyDirvolumes survive but init containers re-execute), the init container (gateway initialize) overwrites/etc/nginx/main-includes/main.conffrom the bootstrap ConfigMap.Previously, the bootstrap template did not include
load_moduledirectives for optional modules like Telemetry (ngx_otel_module.so) or WAF (ngx_http_app_protect_module.so). Consequently, NGINX failed to start on boot withunknown directiveerrors (such as[emerg] unknown directive "otel_exporter" in /etc/nginx/conf.d/http.conf) when parsing the retained configuration in/etc/nginx/conf.d.This PR:
1. Updates the bootstrap
main.conftemplate (mainTemplateTextininternal/controller/provisioner/templates.go) to conditionally loadngx_otel_module.soandngx_http_app_protect_module.so.2. Passes
TelemetryandWAFenablement intobuildBootstrapConfigMapininternal/controller/provisioner/objects.go.3. Exports and sharpens
TelemetryEnabledForNginxProxyininternal/controller/state/graph/nginxproxy.goto ensureEndpointis non-nil and non-empty.4. Adds unit tests in
internal/controller/provisioner/objects_test.gocovering all module loading permutations.Checklist
Before creating a PR, run through this checklist:
make fmtandmake lint<!--
Please include a release note if this PR contains a user-facing change.
-->
```release-note
Fix an issue where data-plane pods failed to recover after init container re-execution when Telemetry or WAF was enabled.