From 2da52158901ee270ea8161f0ed0beba5a58a16fb Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 14 May 2026 11:27:18 -0600 Subject: [PATCH 1/4] chore: [CLI-54049]: Updated changelog and bumped version --- CHANGELOG.md | 5 +++++ src/common/Chart.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b40c29..3219e71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.6.2] - 2026-05-14 + +### Added +- Moved GatewayAPI rendering to be initiated from renderIngress helper if enabled + ## [1.5.2] - 2026-04-02 ### Added diff --git a/src/common/Chart.yaml b/src/common/Chart.yaml index 47a8158..95cb2d7 100644 --- a/src/common/Chart.yaml +++ b/src/common/Chart.yaml @@ -15,7 +15,7 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.6.1 +version: 1.6.2 # This is the version number of the application being deployed. This version number should be From 295ce7c19909a07a473e6b04a5eb51f9b4a2d101 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 14 May 2026 12:18:44 -0600 Subject: [PATCH 2/4] chore: [CLI-54049]: Changing to global.gatewayAPI.parentRef.namespace to default to .Release.Namespace by default but still allow override --- ci/test-chart/Chart.lock | 6 +++--- docs/GATEWAYAPI.md | 15 ++++----------- .../templates/_gateway_clienttrafficpolicy.tpl | 2 +- src/common/templates/_gateway_httproute.tpl | 2 +- src/common/values.yaml | 2 -- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/ci/test-chart/Chart.lock b/ci/test-chart/Chart.lock index 0b4326b..2640b14 100644 --- a/ci/test-chart/Chart.lock +++ b/ci/test-chart/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: harness-common repository: file://../../src/common - version: 1.6.1 -digest: sha256:abd81517861f38863732ba6aad2160a5b370816d8e2939c25f17308dfb9bcea6 -generated: "2026-05-13T17:37:34.960645-06:00" + version: 1.6.2 +digest: sha256:506c6c2051e001ccd5ed3cf0e9ae55382bd4bfde10b7eeba1fc5762f0f469f9d +generated: "2026-05-14T12:15:44.474601-06:00" diff --git a/docs/GATEWAYAPI.md b/docs/GATEWAYAPI.md index 7dd6cd1..eacd9d9 100644 --- a/docs/GATEWAYAPI.md +++ b/docs/GATEWAYAPI.md @@ -387,33 +387,26 @@ With custom ingress configuration: ### Namespace Defaulting -The `parentRef.namespace` defaults to `global.namespace` when not explicitly set: +The `parentRef.namespace` defaults to the Helm release namespace (`.Release.Namespace`) when not explicitly set: ```yaml global: - namespace: harness-helm-new gatewayAPI: enabled: true parentRef: name: envoy-gateway - # namespace: defaults to global.namespace ("harness-helm-new") + # namespace: defaults to .Release.Namespace ``` ## Values Reference -### global - -| Parameter | Type | Default | Description | -|-----------|------|---------|-------------| -| `namespace` | string | `""` | Default namespace; used as fallback for `gatewayAPI.parentRef.namespace` | - ### global.gatewayAPI | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `enabled` | bool | `false` | Enable GatewayAPI HTTPRoute generation (requires `global.ingress.enabled`) | | `parentRef.name` | string | `""` | Name of the parent Gateway resource | -| `parentRef.namespace` | string | `""` | Namespace of the parent Gateway resource (defaults to `global.namespace`) | +| `parentRef.namespace` | string | `""` | Namespace of the parent Gateway resource (defaults to `.Release.Namespace`) | | `parentRef.sectionName` | string | `""` | Specific listener name on the Gateway (optional) | | `parentRef.port` | int | - | Specific port on the Gateway (optional) | @@ -666,7 +659,7 @@ To add GatewayAPI support to an existing service using nginx-ingress: enabled: true # Add GatewayAPI parentRef: name: envoy-gateway - # namespace defaults to global.namespace + # namespace defaults to .Release.Namespace ``` 2. **No template changes needed** - `renderIngress` automatically generates diff --git a/src/common/templates/_gateway_clienttrafficpolicy.tpl b/src/common/templates/_gateway_clienttrafficpolicy.tpl index d8066e4..6d3e448 100644 --- a/src/common/templates/_gateway_clienttrafficpolicy.tpl +++ b/src/common/templates/_gateway_clienttrafficpolicy.tpl @@ -29,7 +29,7 @@ metadata: {{- include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: - {{- $parentRefNamespace := $parentRef.namespace | default $.Values.global.namespace }} + {{- $parentRefNamespace := $parentRef.namespace | default $.Release.Namespace }} targetRefs: - group: gateway.networking.k8s.io kind: Gateway diff --git a/src/common/templates/_gateway_httproute.tpl b/src/common/templates/_gateway_httproute.tpl index 494fca6..bb17533 100644 --- a/src/common/templates/_gateway_httproute.tpl +++ b/src/common/templates/_gateway_httproute.tpl @@ -65,7 +65,7 @@ metadata: spec: {{- if $.Values.global.gatewayAPI.parentRef }} # Default parentRef from global config - {{- $parentRefNamespace := $.Values.global.gatewayAPI.parentRef.namespace | default $.Values.global.namespace }} + {{- $parentRefNamespace := $.Values.global.gatewayAPI.parentRef.namespace | default $.Release.Namespace }} parentRefs: - name: {{ include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.gatewayAPI.parentRef.name "context" $) }} {{- if $parentRefNamespace }} diff --git a/src/common/values.yaml b/src/common/values.yaml index 702befd..ac3f5dc 100644 --- a/src/common/values.yaml +++ b/src/common/values.yaml @@ -1,7 +1,5 @@ global: ha: false - # Namespace used as default for gatewayAPI.parentRef.namespace when not explicitly set - namespace: "" gatewayAPI: # Enable GatewayAPI HTTPRoute generation (requires global.ingress.enabled) enabled: false From dfbce3196b559b5f24ab66362dd4d43ac645e080 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 14 May 2026 13:47:13 -0600 Subject: [PATCH 3/4] chore: [CLI-54049]: Updated changelog and bumped version - Fix nil pointer when charts don't define global.gatewayAPI - Default parentRef.namespace to .Release.Namespace Co-Authored-By: Claude Opus 4.6 AI-Session-Id: 4f9cdbba-9363-442e-a473-42572bf70f96 AI-Tool: claude-code AI-Model: unknown --- CHANGELOG.md | 8 ++++++-- ci/test-chart/Chart.lock | 6 +++--- src/common/Chart.yaml | 2 +- src/common/templates/_ingress.tpl | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3219e71..da9bfe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # Changelog -## [1.6.2] - 2026-05-14 +## [1.6.3] - 2026-05-14 ### Added -- Moved GatewayAPI rendering to be initiated from renderIngress helper if enabled +- `renderIngress` now automatically renders all Gateway API resources (HTTPRoute, BackendTrafficPolicy, ClientTrafficPolicy, SecurityPolicy) when `global.gatewayAPI.enabled` is true +- `parentRef.namespace` defaults to `.Release.Namespace` when not explicitly set + +### Fixed +- Nil pointer error when consuming charts don't define `global.gatewayAPI` in their values ## [1.5.2] - 2026-04-02 diff --git a/ci/test-chart/Chart.lock b/ci/test-chart/Chart.lock index 2640b14..40351f6 100644 --- a/ci/test-chart/Chart.lock +++ b/ci/test-chart/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: harness-common repository: file://../../src/common - version: 1.6.2 -digest: sha256:506c6c2051e001ccd5ed3cf0e9ae55382bd4bfde10b7eeba1fc5762f0f469f9d -generated: "2026-05-14T12:15:44.474601-06:00" + version: 1.6.3 +digest: sha256:b5bf10bcf60184437a0b08ff170b4c7d67630c7239571f18af13824a64250253 +generated: "2026-05-14T13:46:18.921158-06:00" diff --git a/src/common/Chart.yaml b/src/common/Chart.yaml index 95cb2d7..00e1632 100644 --- a/src/common/Chart.yaml +++ b/src/common/Chart.yaml @@ -15,7 +15,7 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.6.2 +version: 1.6.3 # This is the version number of the application being deployed. This version number should be diff --git a/src/common/templates/_ingress.tpl b/src/common/templates/_ingress.tpl index e1eac05..6b660f1 100644 --- a/src/common/templates/_ingress.tpl +++ b/src/common/templates/_ingress.tpl @@ -106,7 +106,7 @@ spec: --- {{- end }} {{- end }} -{{- if .ctx.Values.global.gatewayAPI.enabled }} +{{- if and (dig "gatewayAPI" "enabled" false .ctx.Values.global) .ctx.Values.global.gatewayAPI.enabled }} # Gateway API resources (rendered by harnesscommon.v1.renderIngress) {{- include "harnesscommon.v2.renderHTTPRoute" . }} {{- include "harnesscommon.v2.renderBackendTrafficPolicy" . }} From 1a34f8349cc084b50ed6462a4b8e038c4fc5294f Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 14 May 2026 13:54:19 -0600 Subject: [PATCH 4/4] fix: [CLI-54049]: add hasKey guard before checking gatewayAPI.enabled Co-Authored-By: Claude Opus 4.6 AI-Session-Id: 4f9cdbba-9363-442e-a473-42572bf70f96 AI-Tool: claude-code AI-Model: unknown --- src/common/templates/_ingress.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/templates/_ingress.tpl b/src/common/templates/_ingress.tpl index 6b660f1..70f4c85 100644 --- a/src/common/templates/_ingress.tpl +++ b/src/common/templates/_ingress.tpl @@ -106,7 +106,7 @@ spec: --- {{- end }} {{- end }} -{{- if and (dig "gatewayAPI" "enabled" false .ctx.Values.global) .ctx.Values.global.gatewayAPI.enabled }} +{{- if and (hasKey .ctx.Values.global "gatewayAPI") (dig "gatewayAPI" "enabled" false .ctx.Values.global) }} # Gateway API resources (rendered by harnesscommon.v1.renderIngress) {{- include "harnesscommon.v2.renderHTTPRoute" . }} {{- include "harnesscommon.v2.renderBackendTrafficPolicy" . }}