Skip to content

fix: Populate the k8s in-cluster upstream when twingate.resource is enabled in Helm values file#232

Merged
ekampf merged 1 commit intomasterfrom
fix/mt/better-resource-annotation
Mar 20, 2026
Merged

fix: Populate the k8s in-cluster upstream when twingate.resource is enabled in Helm values file#232
ekampf merged 1 commit intomasterfrom
fix/mt/better-resource-annotation

Conversation

@minhtule
Copy link
Copy Markdown
Contributor

Changes

Populate the k8s in-cluster upstream when twingate.resource is enabled in Helm values file

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Gateway Helm chart so that when twingate.resource.enabled is set, the rendered config.yaml automatically includes a Kubernetes upstreams entry for the in-cluster API server (and optionally derives its display name from the resource annotations).

Changes:

  • Auto-populate an in-cluster Kubernetes upstream when twingate.resource.enabled is true.
  • Allow overriding the auto-created upstream name via twingate.resource.extraAnnotations["resource.twingate.com/name"].
  • Add Helm unit tests covering the new resource-driven Kubernetes upstream behavior and ordering.

Reviewed changes

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

File Description
deploy/gateway/templates/gateway-configmap.yaml Builds the Kubernetes upstream list by prepending the resource-driven in-cluster upstream and then appending any user-specified upstreams (when Kubernetes is enabled).
deploy/gateway/templates/_helpers.tpl Adds helper to compute the in-cluster upstream name, optionally sourced from resource annotations.
deploy/gateway/tests/gateway-configmap_test.yaml Adds test coverage for resource-enabled scenarios: auto upstream creation, name override, ordering with manual upstreams, and behavior when kubernetes.enabled is false.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@minhtule minhtule requested a review from ekampf March 20, 2026 02:30
@minhtule minhtule marked this pull request as ready for review March 20, 2026 02:30
@ekampf ekampf merged commit ef32061 into master Mar 20, 2026
16 checks passed
@ekampf ekampf deleted the fix/mt/better-resource-annotation branch March 20, 2026 03:00
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.61%. Comparing base (5ae05a1) to head (08dae2b).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #232      +/-   ##
==========================================
- Coverage   82.72%   82.61%   -0.12%     
==========================================
  Files          35       35              
  Lines        2628     2628              
==========================================
- Hits         2174     2171       -3     
- Misses        341      345       +4     
+ Partials      113      112       -1     
Flag Coverage Δ
integration 48.50% <ø> (-0.12%) ⬇️
unit 77.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants