mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-10 06:24:09 +09:00
postgres, template0 and template1 were accepted in databases and handled like an application database. The init job made <db>_admin their owner, installed the auto-grant event trigger in them and, once the entry left values, ran DROP DATABASE on them. That DROP can only fail (template databases cannot be dropped, and the job is connected to postgres), so every later upgrade failed in the init job and the release stayed in UpgradeFailed even after the entry was put back. template1 also passed the takeover on to every database created from it afterwards, where the trigger, naming a role about to be dropped, makes CREATE SCHEMA fail. A release a previous version let take one of them over has to be repaired without dropping it, and without touching what this chart did not create: a role or owner that merely carries an expected name may belong to a tenant or an administrator, and a role comment can be set by any CREATEROLE holder, so only the cozystack:managed mark is trusted. What the marked roles own goes to cozystack:orphaned rather than to the superuser, since a tenant's SECURITY DEFINER function would otherwise run with superuser rights. A failed lookup of the databases cloned from template1 has to stop the run before template1 stops being selected, or those clones would never be repaired. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
19 lines
299 B
YAML
19 lines
299 B
YAML
apiVersion: apps.cozystack.io/v1alpha1
|
|
kind: Postgres
|
|
metadata:
|
|
name: sysdb
|
|
spec:
|
|
external: false
|
|
size: 1Gi
|
|
replicas: 1
|
|
storageClass: ""
|
|
quorum:
|
|
minSyncReplicas: 0
|
|
maxSyncReplicas: 0
|
|
users:
|
|
sysdbuser: {}
|
|
databases:
|
|
appdb: {}
|
|
resources: {}
|
|
resourcesPreset: "nano"
|