Skip to content

fix: honour existingClaim and appSecret, roll pods on config changes; strengthen tests - #83

Merged
kernelb00t merged 3 commits into
mainfrom
claude/peaceful-rubin-cncpo6
Oct 7, 2026
Merged

kernelb00t merged 3 commits into
mainfrom
claude/peaceful-rubin-cncpo6

Conversation

@kernelb00t

@kernelb00t kernelb00t commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Chart fixes (1.8.1 → 1.8.2)

  • persistence.*.existingClaim was 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.superuserSecret actually 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.appSecret is used both for initdb and by Paperless;
    • superuserSecret is kept as a deprecated alias.
  • Config/secret changes didn't restart Paperless. Checksum annotations on the Paperless and Redis pods now roll them when paperless.config, paperless.secrets or redis.password change. The checksums are computed from the values, not the rendered manifests, so a chart version bump alone doesn't restart the pods.
  • cnpg.postgresVersion was unused, even though the README says bumping it triggers the major upgrade. It is now the image tag when cnpg.image.tag is empty, which is the new default. The rendered output is unchanged for default values (postgresql:18).
    • ⚠️ Edge case: a release that set postgresVersion to something other than its actual image tag, without setting cnpg.image.tag, will now change images.
  • Renovate: removed the helmv3 manager and its rules. They never matched anything, because the chart has no Chart.yaml dependencies and helmv3 doesn't read images from values.yaml.

Tests

  • Unit tests (helm-unittest, run in the Lint job): 30 cases in paperless-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 upgrade to this chart, then check the tag survived.
    • An Integration Test aggregator 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 of kubectl run -i, which could lose the curl output (the flake seen on fix: default to Recreate strategy and allow CNPG plugins #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.*.existingClaim now mounts the configured PVC instead of the chart-managed name.
  • New cnpg.appSecret configures and reads the application database credentials; superuserSecret remains a deprecated alias.
  • Paperless and Redis pods roll when chart-managed config or secrets change; externally managed secrets still require a manual restart.
  • cnpg.postgresVersion supplies the image tag when cnpg.image.tag is empty, so affected releases may change images on upgrade.
  • Generated checksum keys cannot be overridden through podAnnotations, and null podAnnotations are tolerated.
  • Removed the unused Renovate helmv3 manager and rules.

Tests

  • Added 30 helm-unittest cases 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.

Written for commit e7b5b26. Summary will update on new commits.

View guided diff Turn on auto-fix

Chart fixes (1.8.2):
- persistence.*.existingClaim is now mounted by the Deployment; previously
  the PVC was skipped but the pod still referenced <fullname>-<volume>.
- New cnpg.appSecret (superuserSecret kept as deprecated alias). Paperless
  now reads DB credentials from it instead of the <cluster>-app secret that
  CNPG does not create when a custom initdb secret is given.
- Checksum annotations on the Paperless and Redis pods so changes to
  paperless.config, paperless.secrets or redis.password trigger a rollout.
- cnpg.postgresVersion is now used as the image tag when cnpg.image.tag is
  empty (new default), matching the README.
- Renovate: drop the helmv3 manager and its rules, which never matched.

Tests:
- helm-unittest suites covering strategy, volumes, DB secret, checksums,
  CNPG image/plugins/initdb secret, PVCs, Redis and secret validation.
- Integration tests run as an install/upgrade matrix: the upgrade scenario
  installs the latest published chart, writes data through the API,
  upgrades to this chart and checks the data survived.
- Smoke test uses a port-forward with retries and an authenticated API
  call instead of `kubectl run -i`, which could lose the curl output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QD1kFPcmFFoZmmgw6t4XGw

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 17 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread README.md
Comment thread .github/workflows/ci.yml Outdated
Comment thread paperless-ngx/tests/redis_test.yaml Outdated
Comment thread paperless-ngx/templates/deployment.yaml
Comment thread .github/scripts/smoke-test.sh
Comment thread paperless-ngx/templates/redis/deployment.yaml Outdated
Comment thread paperless-ngx/templates/deployment.yaml
Comment thread .github/scripts/wait-ready.sh
Comment thread .github/scripts/smoke-test.sh Outdated
Comment thread .github/scripts/smoke-test.sh Outdated
- podAnnotations can no longer override the generated checksum keys.
- Redis checksums only when the chart-managed password is actually used
  (not with passwordSecretKeyRef); document that external secrets need a
  manual restart, and that cnpg.appSecret only applies at cluster creation.
- Unit tests now pin the secret/Redis checksums and check they change.
- Smoke test: curl timeouts, port-forward liveness check, retries on every
  API call, and unknown actions are rejected.
- wait-ready.sh fails with an explicit error when the Cluster never appears.
- Integration Test gate only accepts a skip when the path filter ran and
  found no chart changes (not when Lint failed).
- README: PostgreSQL component is :18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QD1kFPcmFFoZmmgw6t4XGw

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files (changes from recent commits).

Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/scripts/smoke-test.sh Outdated
Comment thread paperless-ngx/templates/deployment.yaml Outdated
@kernelb00t
kernelb00t merged commit 7316235 into main Oct 7, 2026
8 checks passed
@kernelb00t
kernelb00t deleted the claude/peaceful-rubin-cncpo6 branch October 7, 2026 12:59
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.

2 participants