Skip to content

fix(executor): render tolerations as json#902

Open
jojosenthusiast wants to merge 1 commit into
sourcegraph:mainfrom
jojosenthusiast:fix-executor-tolerations-json
Open

fix(executor): render tolerations as json#902
jojosenthusiast wants to merge 1 commit into
sourcegraph:mainfrom
jojosenthusiast:fix-executor-tolerations-json

Conversation

@jojosenthusiast

@jojosenthusiast jojosenthusiast commented Jun 29, 2026

Copy link
Copy Markdown

Fixes #349

Reproduction

When executor.kubernetesJob.node.tolerations is provided as a YAML list, the executor ConfigMap rendered it as a Go-style map[...] string instead of JSON. The executor then fails to parse EXECUTOR_KUBERNETES_NODE_TOLERATIONS.

Fix summary

  • Render non-string tolerations values with toJson | quote.
  • Preserve existing string/default behavior for pre-encoded JSON strings and the default empty string.
  • Add helm-unittest coverage for YAML list, pre-encoded JSON string, and default empty string inputs.
  • Add the executor k8s chart unittest suite to the existing Buildkite unittest script.

Tests run

  • git diff --check upstream/main...HEAD → pass
  • sh -n scripts/ci/helm-unittest.sh → pass
  • helm unittest -q charts/sourcegraph-executor/k8s → pass, 10/10 tests
  • helm lint charts/sourcegraph-executor/k8s → pass, 1 chart linted, 0 failed (existing metadata-name warnings only)
  • Static CI wiring check: .buildkite/pipeline.yaml runs scripts/ci/helm-unittest.sh, and the script now runs helm unittest -q charts/sourcegraph-executor/k8s

Risk

Low. Defaults remain unchanged and string inputs are preserved; YAML list/map inputs now render as JSON for the executor.

Non-goals

  • No changes to executor chart defaults.
  • No changes to sibling executor config fields with similar rendering patterns.

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.

Executor Helm Chart - kubernetesJob.node.tolerations doesn't render as expected

1 participant