After the controller-runtime v0.24.0 upgrade (58f4fed), the instance
sidecar logged "v1.GetOptions is not suitable for converting to
postgresql.cnpg.io/v1" on every WAL archive, which broke retention
policy enforcement.
Register the standard meta types with metav1.AddToGroupVersion after the
AddKnownTypes call in internal/cnpgi/common/scheme.go and
internal/scheme/cnpg.go.
Closes#942
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
The restore manager used a hardcoded scheme registration that ignored
CUSTOM_CNPG_GROUP and CUSTOM_CNPG_VERSION, causing restore jobs to fail
under non-standard CNPG API groups.
Extract `generateScheme()` into `common.GenerateScheme()` and use it
from both instance and restore managers.
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>