From 3112406e0112d00db5ed41e86af44332701dd8f2 Mon Sep 17 00:00:00 2001 From: Marc LeBlanc <7050295+marcleblanc2@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:43:51 -0500 Subject: [PATCH] charts: fix three templates that fail to render when their value is set - jaeger.serviceAccount.create: true failed with a nil pointer, because jaeger.ServiceAccount.yaml looked up values under "tracing", which is not a values key. Use "jaeger", as the jaeger Deployment does. - openTelemetry.agent.env indented each list item under env, so value: landed outside its item and the YAML was invalid. - privateDockerRegistry.serviceAnnotations indented annotations: under metadata by 4 spaces instead of 2, which made the YAML invalid. The kustomize render check's allValues files now render. Co-authored-by: Amp Amp-Thread-ID: https://ampcode.com/threads/T-01a2140d-bf64-751f-9812-0c8757baf6fd --- charts/sourcegraph-executor/CHANGELOG.md | 1 + .../private-docker-registry.Service.yaml | 2 +- charts/sourcegraph/CHANGELOG.md | 2 ++ .../sourcegraph/templates/jaeger/jaeger.ServiceAccount.yaml | 4 ++-- .../templates/otel-collector/otel-agent.DaemonSet.yaml | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/charts/sourcegraph-executor/CHANGELOG.md b/charts/sourcegraph-executor/CHANGELOG.md index 5f542ed08..c8245ad7b 100644 --- a/charts/sourcegraph-executor/CHANGELOG.md +++ b/charts/sourcegraph-executor/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased +- Fixed `privateDockerRegistry.serviceAnnotations` in the `sourcegraph-executor-dind` chart rendering invalid YAML, which failed the render. - Fixed a label or pod annotation key set both in `sourcegraph.labels`, `sourcegraph.podLabels`, or `sourcegraph.podAnnotations` and in the `executor` or `privateDockerRegistry` equivalent being rendered twice in one map. Helm used the last one, but kustomize rejected the manifest. Each key is now rendered once, with the component's value, so Helm releases render the same objects as before. ## 8.0.0 diff --git a/charts/sourcegraph-executor/dind/templates/private-docker-registry/private-docker-registry.Service.yaml b/charts/sourcegraph-executor/dind/templates/private-docker-registry/private-docker-registry.Service.yaml index 356293ca8..5bf5e9cba 100644 --- a/charts/sourcegraph-executor/dind/templates/private-docker-registry/private-docker-registry.Service.yaml +++ b/charts/sourcegraph-executor/dind/templates/private-docker-registry/private-docker-registry.Service.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: {{- if .Values.privateDockerRegistry.serviceAnnotations }} - annotations: + annotations: {{- toYaml .Values.privateDockerRegistry.serviceAnnotations | nindent 4 }} {{- end }} labels: diff --git a/charts/sourcegraph/CHANGELOG.md b/charts/sourcegraph/CHANGELOG.md index 12f07b577..3a8792a0b 100644 --- a/charts/sourcegraph/CHANGELOG.md +++ b/charts/sourcegraph/CHANGELOG.md @@ -8,6 +8,8 @@ Use `**BREAKING**:` to denote a breaking change ## Unreleased +- Fixed `jaeger.serviceAccount.create: true` failing the render with `index of nil pointer`. The ServiceAccount now reads `jaeger.serviceAccount.name` and `jaeger.serviceAccount.annotations`, and its name matches the one the `jaeger` Deployment uses. +- Fixed `openTelemetry.agent.env` rendering invalid YAML, which failed the render. - Fixed a label or pod annotation key set both globally (`sourcegraph.labels`, `sourcegraph.podLabels`, `sourcegraph.podAnnotations`) and per component (`.labels`, `.podLabels`, `.podAnnotations`, or `openTelemetry.gateway.serviceLabels`) being rendered twice in one map. Helm used the last one, but kustomize rejected the manifest. Each key is now rendered once, with the component's value, so Helm releases render the same objects as before. - The `correct-data-dir-permissions` init containers of `pgsql`, `codeintel-db`, and `codeinsights-db` now run the database's own image instead of `sourcegraph/alpine-3.14`, which was based on an end-of-life Alpine release. The chart no longer pulls `alpine-3.14`, so private registries no longer need to mirror it. `alpine.image` has been removed and is ignored if set; `alpine.containerSecurityContext`, `alpine.resources`, and `codeInsightsDB.init.containerSecurityContext` still apply. - Added `sourcegraph.selectorLabelsOverride`, `.extraSelectorLabels`, and `storageLabels` on `gitserver`, `grafana`, `indexedSearch`, and `searcher`, so the chart can render the selectors and volume claim templates of workloads created outside it, such as with Kustomize, and a Helm release can take them over without deleting them. All default to empty, so existing releases render the same selectors. Never change them on an installed release: Kubernetes does not allow changing these fields. See [Adopting existing workloads](README.md#adopting-existing-workloads). diff --git a/charts/sourcegraph/templates/jaeger/jaeger.ServiceAccount.yaml b/charts/sourcegraph/templates/jaeger/jaeger.ServiceAccount.yaml index 1832c6b4c..862d5be05 100644 --- a/charts/sourcegraph/templates/jaeger/jaeger.ServiceAccount.yaml +++ b/charts/sourcegraph/templates/jaeger/jaeger.ServiceAccount.yaml @@ -6,6 +6,6 @@ metadata: category: rbac deploy: sourcegraph app.kubernetes.io/component: tracing - {{- include "sourcegraph.serviceAccountAnnotations" (list . "tracing") | trim | nindent 2 }} - name: {{ include "sourcegraph.serviceAccountName" (list . "tracing") }} + {{- include "sourcegraph.serviceAccountAnnotations" (list . "jaeger") | trim | nindent 2 }} + name: {{ include "sourcegraph.serviceAccountName" (list . "jaeger") }} {{- end }} diff --git a/charts/sourcegraph/templates/otel-collector/otel-agent.DaemonSet.yaml b/charts/sourcegraph/templates/otel-collector/otel-agent.DaemonSet.yaml index a47c732e5..cf26df8b9 100644 --- a/charts/sourcegraph/templates/otel-collector/otel-agent.DaemonSet.yaml +++ b/charts/sourcegraph/templates/otel-collector/otel-agent.DaemonSet.yaml @@ -44,7 +44,7 @@ spec: terminationMessagePolicy: FallbackToLogsOnError env: {{- range $name, $item := .Values.openTelemetry.agent.env}} - - name: {{ $name }} + - name: {{ $name }} {{- $item | toYaml | nindent 10 }} {{- end }} resources: