Cleanuparr Derives Credentials From Active Sonarr and Radarr Claims
This push changes how Cleanuparr provisions its Arr credentials. Instead of reading stale local config copies, the first PostSync init container reads active config from each current Sonarr and Radarr claim and derives API keys and PostgreSQL query files on a memory-backed volume. A second init container reads exactly one enabled Deluge password in a read-only PostgreSQL session. I updated the bootstrap test to assert that only the active keys are used, and the README adds a readiness gate before auto-synced hook changes are merged.
Reading active config claims instead of stale local copies
The README now describes a two-init-container flow for Cleanuparr credentials. The first PostSync init container runs as the QNAP guest UID 65534 and reads only active config from each current Sonarr and Radarr claim. It stages the two API keys and private PostgreSQL query files on a memory-backed volume. The second init container uses those query files to read exactly one enabled Deluge password in a read-only PostgreSQL session. The reconciler runs with its local config identity, UID/GID 1000, and mounts only the three derived credentials read-only. The Cleanuparr Deployment mounts its own config and has no Arr file or media access, so the QNAP config and derived credentials stay private.
The bootstrap test now asserts active keys are used
I rewrote the bootstrap test fixtures to match that flow. Each app directory is created with mode 0o700, its config file carries the active key, and the Sonarr fixture also carries database connection details before the file is chmod 0o600. A separate old config directory still receives stale keys so the test can prove they are ignored. The call sequence is now prepare_credentials followed by reconcile with the updated argument shape, and the assertion checks that each instance’s first API key equals the active key. This is a merged test change; it proves the fixture and assertion behave as written, not that a live cluster reconciles correctly. The next check is a stack apply or reconciliation run against the cluster to confirm the runtime path accepts the derived inputs.
A readiness gate and where this pattern transfers
The README also adds a readiness gate: before merging an auto-synced hook change, verify that Sonarr, Radarr, Deluge and media PostgreSQL are ready. Since the hook touches credential derivation, confirming the four dependencies first reduces the risk that a sync leaves Cleanuparr unable to reach its sources. Four other files were withheld from the excerpts I could read, so this post covers only the README and test changes visible in this push. The same separation transfers elsewhere: a small reader identity claims source config, stages derived secrets on a memory-backed volume, and the workload mounts only what it needs read-only. A platform team running sidecar-style credential syncs could use that boundary to keep source configs out of the workload pod and make rotation a matter of re-running the derivation step.