paperless-ngx: an empty barcodes block falls back to the chart defaults

A "barcodes:" key left without children (e.g. after deleting the last
remaining sub-key, PAPERLESS_CONSUMER_BARCODE_SCANNER, which paperless-ngx
3.0 removed) is YAML null and replaced the whole default sub-tree on merge.
Rendering then failed on the nil pointer, so the release simply stopped
updating.

An empty or null block now means "the chart defaults apply". The merge runs
through a new paperless-ngx.defaultedDict helper: nulls never delete, nested
maps merge recursively, and explicitly set values win - including false and 0,
which "default" and "mergeOverwrite" would swallow. A scalar where the
defaults define a map is rejected with the values path in the message.

Major bump: the meaning of a values override changes.

Fixes #61
This commit is contained in:
jklein committed 2026-08-23 19:31:20 +02:00
1 parent f5bbffca3c
commit 4f489b0854
5 files changed
+99 -5

No files matched your search

@@ -1,3 +1,8 @@
{{- /*
Barcode settings, defended against a null / empty "barcodes:" override:
an empty block falls back to the chart defaults (issue #61).
*/ -}}
{{- $barcodes := fromYaml (include "paperless-ngx.barcodes" .Values.paperless.files.barcodes) -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -137,13 +142,13 @@ spec:
- name: PAPERLESS_URL
value: "https://{{ .Values.ingress.domain }}"
- name: PAPERLESS_CONSUMER_ENABLE_ASN_BARCODE
value: "{{ .Values.paperless.files.barcodes.asn.enabled }}"
value: "{{ $barcodes.asn.enabled }}"
- name: PAPERLESS_CONSUMER_ENABLE_BARCODES
value: "{{ .Values.paperless.files.barcodes.enabled }}"
value: "{{ $barcodes.enabled }}"
- name: PAPERLESS_CONSUMER_BARCODE_STRING
value: "{{ .Values.paperless.files.barcodes.barcodeString }}"
value: "{{ $barcodes.barcodeString }}"
- name: PAPERLESS_CONSUMER_BARCODE_RETAIN_SPLIT_PAGES
value: "{{ .Values.paperless.files.barcodes.retainBarcodePage }}"
value: "{{ $barcodes.retainBarcodePage }}"
- name: PAPERLESS_CONSUMER_DELETE_DUPLICATES
value: "{{ .Values.paperless.files.deleteDuplicates }}"
{{- if .Values.paperless.files.tikaGotenberg.enabled }}