Files
Timofei Larkin 9c6df6f477 fix(postgres): check only roles new to the Cluster
The pre-upgrade refusal connected to the database on every upgrade, so
a database that was down blocked every upgrade, the resize that might
have fixed it included: the hook failed after its wait and Helm applied
nothing. Only a name CNPG does not manage yet can be planted before its
adoption, so the hook now reads the live Cluster first and connects to
the database only when the upgrade adds such a name or newly grants
createRole.

It reads the Cluster at run time with a ServiceAccount that may get
only that Cluster, rather than through a template lookup: nothing
re-renders a release when a looked-up object changes, and the render
stays free of cluster state. A Cluster that cannot be read counts as
managing nothing, so the check still fails closed. The hook moves under
templates/hooks, where the kubectl image pin is kept current.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-10-29 15:56:05 +01:00
..