diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b40c29..da9bfe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [1.6.3] - 2026-05-14 + +### Added +- `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 ### Added diff --git a/ci/test-chart/Chart.lock b/ci/test-chart/Chart.lock index 0b4326b..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.1 -digest: sha256:abd81517861f38863732ba6aad2160a5b370816d8e2939c25f17308dfb9bcea6 -generated: "2026-05-13T17:37:34.960645-06:00" + version: 1.6.3 +digest: sha256:b5bf10bcf60184437a0b08ff170b4c7d67630c7239571f18af13824a64250253 +generated: "2026-05-14T13:46:18.921158-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/Chart.yaml b/src/common/Chart.yaml index 47a8158..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.1 +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/_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/templates/_ingress.tpl b/src/common/templates/_ingress.tpl index e1eac05..70f4c85 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 (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" . }} 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