fix: honour existingClaim and appSecret, roll pods on config changes; strengthen tests
Merged
KE
21d ago+724+724+012345678901234567890123456789-83-83-01234567890123456789
Chart fixes (1.8.1 ā 1.8.2)
persistence.*.existingClaimwas broken. With it set, the PVC was skipped but the Deployment still mounted<fullname>-<volume>, so the pod stayed Pending. It now mounts the existing claim.- Custom DB secret was broken.
cnpg.superuserSecretactually set the application user secret (bootstrap.initdb.secret), and CNPG then doesn't create<cluster>-app. But Paperless always read<cluster>-app. Now:- the new
cnpg.appSecretis used both for initdb and by Paperless; superuserSecretis kept as a deprecated alias.
- the new
- Config/secret changes didn't restart Paperless. Checksum annotations on the Paperless and Redis pods now roll them when
paperless.config,paperless.secretsorredis.passwordchange. The checksums are computed from the values, not the rendered manifests, so a chart version bump alone doesn't restart the pods. cnpg.postgresVersionwas unused, even though the README says bumping it triggers the major upgrade. It is now the image tag whencnpg.image.tagis empty, which is the new default. The rendered output is unchanged for default values (postgresql:18).- ā ļø Edge case: a release that set
postgresVersionto something other than its actual image tag, without settingcnpg.image.tag, will now change images.
- ā ļø Edge case: a release that set
- Renovate: removed the
helmv3manager and its rules. They never matched anything, because the chart has no Chart.yaml dependencies andhelmv3doesn't read images from values.yaml.
Tests
-
Unit tests (
helm-unittest, run in the Lint job): 30 cases inpaperless-ngx/tests/, excluded from the package via.helmignore. They cover:- update strategy;
- volumes and
existingClaim; - DB secret selection;
- checksums;
- CNPG image, plugins and initdb secret;
- PVCs, Redis, and secret validation.
Checked that they fail against the previous templates.
-
Integration tests now run as a matrix:
install: fresh install.upgrade: install the latest published chart from GHCR, create a tag through the API,helm upgradeto this chart, then check the tag survived.- An
Integration Testaggregator job keeps the existing check name.
-
Smoke test moved to
.github/scripts/smoke-test.sh. It uses a port-forward with retries plus an authenticated API call, instead ofkubectl run -i, which could lose the curl output (the flake seen on #82).
Local validation
helm lint,helm unittest(30/30)- Rendered output unchanged for default values apart from the chart label and the new checksum annotations
- shellcheck on the scripts, workflow validated against the GitHub Actions schema
š¤ Generated with Claude Code
https://claude.ai/code/session_01QD1kFPcmFFoZmmgw6t4XGw
Generated by Claude Code
Summary by cubic
Fixes chart configuration bugs, makes cnpg.postgresVersion effective, and adds safer rollout and CI coverage.
persistence.*.existingClaimnow mounts the configured PVC instead of the chart-managed name.- New
cnpg.appSecretconfigures and reads the application database credentials;superuserSecretremains a deprecated alias. - Paperless and Redis pods roll when chart-managed config or secrets change; externally managed secrets still require a manual restart.
cnpg.postgresVersionsupplies the image tag whencnpg.image.tagis empty, so affected releases may change images on upgrade.- Generated checksum keys cannot be overridden through
podAnnotations, and nullpodAnnotationsare tolerated. - Removed the unused Renovate
helmv3manager and rules.
Tests
- Added 30
helm-unittestcases for strategies, volumes, claims, database secrets, checksums, CNPG images, PVCs, Redis, and secret validation. - CI now tests fresh installs and upgrades from the latest published chart, including data persistence.
- Smoke tests use authenticated API calls through a resilient port-forward with retries and timeouts.
- Readiness checks fail explicitly when the CNPG cluster does not appear, and the integration gate distinguishes skipped path-filter runs from failed jobs.