← Back to Pull requests

fix: render NGINX service patches in helm chart #5857

Closed
unknown closed this pull request without merging on Sep 10, 2026 13:48 UTC
View on GitHub
unknown unknown commented on Sep 04, 2026 15:22 UTC
Author

Proposed changes

Problem: When specifying the patches list in the NGINX Service section of the helm chart, patches were not being rendered properly because filterEmptyFields relied on merge (Sprig/mergo), which is intended for deep-merging maps and could encounter issues or drop slice elements.

Solution: Updated the filterEmptyFields template helper in _helpers.tpl to use set $result $key $value instead of merge. Because set directly assigns key-value pairs into the dictionary, slices (like patches, nodePorts, etc.) and complex fields are preserved cleanly without needing custom omit workarounds or template-level manual rendering.

Testing:

  • Ran helm lint charts/nginx-gateway-fabric (0 errors).

  • Manually verified Helm template output across multiple configurations:

  • - Default values (patches: [] correctly omitted)
    - Service patches with StrategicMerge and JSONPatch (properly rendered under spec.kubernetes.service.patches)
    - Deployment and DaemonSet patches (properly rendered under their respective sections)
    - Multi-field configurations (loadBalancerIP, loadBalancerSourceRanges, nodePorts, patches)

    Closes #5817

    Checklist

    Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc

  • I have added tests that prove my fix is effective or that my feature works

  • I have checked that all unit tests pass after adding my changes

  • I have updated necessary documentation

  • I have rebased my branch onto main

  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork
  • Release notes

    ```release-note
    Fix NGINX Service patches rendering in Helm chart.

    Diff: 231 lines (+173 / -58) across 2 files Reviewer: devaniketh Review duration: 8545m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 231 lines diff across 2 files
    0.60
    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.326
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #5857"
    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: 60.2% (MEDIUM) · Higher = larger blast radius
    60.2%
    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: 23.8% · Safe to merge
    23.8%