← Back to Pull requests

fix: load telemetry and WAF modules in bootstrap config (#5818) #5858

Closed
unknown closed this pull request without merging on Sep 11, 2026 16:49 UTC
View on GitHub
unknown unknown commented on Sep 04, 2026 16:19 UTC
Author

Proposed Changes

Closes #5818

When an NGF data-plane pod is re-initialized (e.g., following a node or runtime disruption where emptyDir volumes survive but init containers re-execute), the init container (gateway initialize) overwrites /etc/nginx/main-includes/main.conf from the bootstrap ConfigMap.

Previously, the bootstrap template did not include load_module directives for optional modules like Telemetry (ngx_otel_module.so) or WAF (ngx_http_app_protect_module.so). Consequently, NGINX failed to start on boot with unknown directive errors (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.conf template (mainTemplateText in internal/controller/provisioner/templates.go) to conditionally load ngx_otel_module.so and ngx_http_app_protect_module.so.
2. Passes Telemetry and WAF enablement into buildBootstrapConfigMap in internal/controller/provisioner/objects.go.
3. Exports and sharpens TelemetryEnabledForNginxProxy in internal/controller/state/graph/nginxproxy.go to ensure Endpoint is non-nil and non-empty.
4. Adds unit tests in internal/controller/provisioner/objects_test.go covering all module loading permutations.

Checklist

Before creating a PR, run through this checklist:

  • You have read the CONTRIBUTING doc

  • You have a meaningful title for your PR

  • You have added tests that exercise your changes

  • You have run make fmt and make lint

  • You have verified all unit tests pass
  • <!--
    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.

    Diff: 242 lines (+181 / -61) across 3 files Reviewer: devaniketh Review duration: 10109m
    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
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.0% (MEDIUM) · Higher = larger blast radius
    62.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.5% · Safe to merge
    24.5%