← Back to Pull requests

fix: propagate commonLabels to kgateway controller pod template #14507

Merged
puertomontt merged 2 files (5 lines) on Aug 03, 2026 17:11 UTC
View on GitHub
puertomontt puertomontt commented on Aug 03, 2026 12:22 UTC
Author

Description

The Helm chart's commonLabels value is documented as applying to "all resources created by the Helm chart," and it is already merged into every resource's own metadata.labels via the kgateway.labels helper (Deployment, Service, ServiceAccount, PodDisruptionBudget, etc.). However, the controller Deployment's pod template labels (spec.template.metadata.labels) were built only from kgateway.selectorLabels plus a hardcoded app.kubernetes.io/component: controller, so commonLabels never reached the running controller pods.

This change adds commonLabels to the pod template labels, keeping it separate from selectorLabels (which also backs the immutable spec.selector.matchLabels, so it must stay stable across upgrades).

Fixes #14503

Change type

/kind fix

Changelog

``release-note
Custom labels set via the Helm chart's
commonLabels value now propagate to the kgateway controller's pod template, in addition to the Deployment's own metadata.
`

Additional notes

  • Regenerated the additional-labels golden test in test/helm/testdata/kgateway/ (REFRESH_GOLDEN=true go test -run TestHelmChartTemplate ./test/helm/...); it was the only golden file affected.

  • Verified with helm lint install/helm/kgateway and the full go test ./test/helm/...` suite.
  • Diff: 5 lines (+5 / -0) across 2 files Reviewer: ymesika Review duration: 288m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.15) × (1 − Review Confidence (0.59)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.15 · 5 lines diff across 2 files
    0.15
    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: 50%
    59%
    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
    Shallow Review Depth shallow_review_depth
    0.289
    Diff Size diff_size
    0.107
    Real PR Conversation Timeline
    3 items
    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Aug 03, 2026 12:26 UTC
    Reviewer

    Pull request overview

    This PR fixes the kgateway Helm chart so that user-specified commonLabels also apply to the controller Deployment’s pod template labels (spec.template.metadata.labels), ensuring the labels reach the running controller pods while keeping selector labels unchanged (and therefore upgrade-safe).

    Changes:

  • Add .Values.commonLabels into the controller pod template labels in install/helm/kgateway/templates/deployment.yaml.

  • Regenerate the Helm golden output to reflect the added pod template labels.
  • Reviewed changes

    Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

    | File | Description |
    | ---- | ----------- |
    | install/helm/kgateway/templates/deployment.yaml | Propagates commonLabels into the controller pod template labels without affecting immutable selector labels. |
    | test/helm/testdata/kgateway/additional-labels.golden | Updates expected rendered manifests to include the extra labels on the controller pod template. |

    ymesika ymesika approved these changes on Aug 03, 2026 12:38 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    puertomontt puertomontt
    Labels
    risk: low confidence: 59.5% reviewed
    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: 15.2% (LOW) · Higher = larger blast radius
    15.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: 59.5% · Lower = rushed or shallow review
    59.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: 6.1% · Safe to merge
    6.1%