# YAML-scalar overlay for paperless-ngx (Gitea #11). # # THIS FILE IS THE TEST CASE the issue asked for, and its first job is to make # an object exist at all. templates/paperless-consume.cronjob.yaml sits behind # smbConnection.enabled, which is false in the chart defaults and false in # ci/paperless-ngx/test-values.yaml - deliberately, because the install-test has # no SMB CSI driver. So before this overlay NOTHING in the repository rendered # that CronJob: not lint, not the render tests, not the install-test. That is # the whole reason an unquoted schedule survived in a shipped chart, and it is # why the fix comes with a render test rather than with a fixture change. # # The values below are hostile on purpose. Against the chart before 13.0.0 this # overlay does not produce a finding - it produces an aborted render, which this # test reports as the finding it is: # # Error: YAML parse error on paperless-ngx/templates/paperless-consume.cronjob.yaml: # error converting YAML to JSON: yaml: line 6: did not find expected # alphabetic or numeric character smbConnection: enabled: true server: "//smb.ci.local/scans" # A schedule beginning with "*" - the commonest cron notation there is, and # the one that YAML reads as an alias indicator. Written here as a quoted # string, which is exactly how an operator would write it and exactly what # does NOT help: Helm passes the content through, and without | quote in the # template the star stands bare in the manifest again. cronJob: "*/15 * * * *" secrets: # The CronJob's SMB volume has a required() secret ref behind it; the # PersistentVolume names it as nodeStageSecretRef. Nothing is mounted in a # render, so no fixture Secret is needed - only a value that satisfies the # required(). smbConnectionSecretRef: op://ci/paperless-smb paperless: # The silent half of the genus, on the chart's additive env block: both of # these are STRINGS in this file and both are schema-valid, and before 13.0.0 # the first one aborted the render while the second arrived in the manifest as # a YAML bool - which the API server rejects at apply time with "cannot # unmarshal bool into Go struct field EnvVar.value of type string", so the # render test is the only place it can be caught cheaply. env: - name: PAPERLESS_STAR_VALUE value: "*never-interpreted*" - name: PAPERLESS_BOOLEAN_LOOKING_VALUE value: "true" # The variable the whole env block was asked for (Gitea #112): the log off # the NFS-backed RWX data volume and onto the /tmp emptyDir this pod already # mounts. Harmless in a render, and it keeps the worked example honest by # being the one an operator will actually copy. - name: PAPERLESS_LOGGING_DIR value: "/tmp/paperless-log"