Files
cozystack/internal/controller
Andrei Kvapil d4f1381bda feat(controller): seed account Secrets from CredentialTemplates
The account list now comes from the chart, so something has to turn a
rendered CredentialTemplate into an account Secret. The controller seeds
a missing Secret, but only on a release marked for seeding: the mark
says no client holds a password a seeded one would replace, which is
true for a release the API created and, after the conversion, for a
converted one. It seeds again when the template's format changes, adopts
an unowned Secret the conversion wrote, leaves any other Secret at the
name alone, and mirrors the Secret's record into the template's status.

A second reconciler adds a valuesFrom entry per template that names a
valuesPath, for an engine whose operator reads no Secret. A template
reaches it one event at a time, and a conversion writes the Secrets and
their entries before the converted chart renders the templates, so an
entry whose Secret still exists is kept until its template is seen; it
goes once the Secret is gone. The ApplicationDefinition reconciler keeps
these entries rather than resetting valuesFrom to the platform values.

HelmReleases are watched for the seed mark appearing or going, filtered
so helm-controller's status writes do not wake the controller. Without
that, a template the chart rendered before the release carried the mark
stayed unseeded until the next resync, which on MariaDB turned into a
ten-minute Helm timeout on the unready User.

Account Secrets are read through the uncached reader and watched as
metadata, because an account Secret may hold a plaintext that has no
business in a cache.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-24 23:06:02 +01:00
..