Skip to content

fix: render deployments when podAnnotations is null - #173

Open
RaphaelFakhri wants to merge 1 commit into
livekit:masterfrom
RaphaelFakhri:fix/pod-annotations-null
Open

RaphaelFakhri wants to merge 1 commit into
livekit:masterfrom
RaphaelFakhri:fix/pod-annotations-null

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Summary

Setting podAnnotations: null is the Helm way to remove the default sidecar.istio.io/inject and linkerd.io/inject pod annotations (an empty map {} merges with the defaults and keeps them). With null, the with .Values.podAnnotations block skips the annotations: key, but checksum/config is still emitted with annotation indentation directly under the pod metadata. The livekit-server, egress, and ingress charts then fail to install:

Error: YAML parse error on livekit-server/templates/deployment.yaml: error converting YAML to JSON: yaml: line 19: did not find expected key

This change always emits the annotations block with checksum/config and appends podAnnotations to it. Rendering with the default values is unchanged apart from the order of the annotation keys.

Testing

Each chart gets a ci/ directory that chart-testing picks up in ct lint and ct install:

  • ci/default-values.yaml keeps the existing install with default values.
  • ci/no-pod-annotations-values.yaml sets podAnnotations: null.

helm lint keeps the null-valued key and does not catch the error, so ct install is the step that covers it. Local check with Helm v3.11.2 (the CI version) and kubeconform -strict:

for f in */ci/*-values.yaml; do helm template t ./${f%%/*} -f $f | kubeconform -strict -summary -; done
  • Before the template change: 3 passed, 3 failed (did not find expected key for each no-pod-annotations-values.yaml).
  • After: 6 passed, 0 failed.

ct lint --all --chart-dirs . --validate-maintainers=false passes for all three charts. Chart versions are not bumped; the version check passes as is.

Fixes #172

Setting podAnnotations to null, the Helm way to drop the default
sidecar.istio.io/inject and linkerd.io/inject annotations, skipped the
annotations key but still emitted checksum/config, leaving it indented
under pod metadata. helm install and helm template then failed with
"YAML parse error ... did not find expected key" for livekit-server,
egress and ingress.

Always emit the annotations block with checksum/config and append
podAnnotations to it. Add chart-testing ci values files so ct install
covers both the default values and podAnnotations: null.
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.

podAnnotations: null breaks rendering of livekit-server, egress, and ingress charts

1 participant