cozystack/packages/apps
Aleksei Sviridkin bdaaae92e2
feat(postgres): add serverName parameter for backup recovery (#2362)
## Summary

Add `serverName` field to bootstrap configuration to support backup
recovery when the Barman server name in `backup.info` differs from the
Kubernetes cluster name.

This fixes "no target backup found" errors during CloudNativePG recovery
operations.

## Problem

CloudNativePG forms the backup path as `destinationPath + "postgres-" +
oldName`, but searches for backups using the `server_name` field from
`backup.info`. When these values don't match (e.g., cluster name is
`grafana` but `server_name` is `cloud`), recovery fails with "no target
backup found".

## Solution

- Add optional `serverName` parameter to `bootstrap` configuration
- When specified, CloudNativePG uses this value to search for backups in
S3
- Falls back to `oldName` when `serverName` is not provided (backwards
compatible)

## Changes

- Add `ServerName` field to PostgreSQL CRD type definition
- Add conditional `serverName` to Cluster `externalClusters` template  
- Update `values.yaml` and README.md with `serverName` documentation
- Regenerate `values.schema.json` and `postgres.yaml` CRD

## Test plan

- [ ] Deploy postgres cluster with backups enabled
- [ ] Create backup
- [ ] Create new postgres instance with `bootstrap.enabled=true`,
`bootstrap.oldName=<original-name>`, and
`bootstrap.serverName=<value-from-backup.info>`
- [ ] Verify recovery completes successfully

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added an optional bootstrap.serverName setting to specify the Barman
server name from the original cluster’s backup.info (used when that
server name differs from the Kubernetes cluster name).

* **Documentation**
* Clarified that bootstrap.oldName must match the serverName value
recorded in backup.info; updated docs and examples to reflect the new
bootstrap.serverName option.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-28 15:32:57 +03:00
..
bucket fix(controller): address review findings for BucketClaim reconciler 2026-04-17 10:58:47 +03:00
clickhouse feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
foundationdb feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
harbor fix(platform): migrate ACME HTTP-01 to ingressClassName API 2026-04-21 17:00:31 +05:00
http-cache feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
kafka feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
kubernetes fix(kubernetes): close admin-kubeconfig race on tenant cluster bootstrap (#2413) 2026-04-27 15:31:52 +03:00
mariadb Prepare release v1.3.0 2026-04-22 07:28:09 +00:00
mongodb feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
nats feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
openbao feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
opensearch feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
postgres docs(postgres): clarify bootstrap field descriptions 2026-04-21 14:34:30 +03:00
qdrant feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
rabbitmq feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
redis feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
tcp-balancer feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
tenant refactor(ingress): move CiliumLoadBalancerIPPool to tenant chart 2026-04-24 16:44:46 +03:00
vm-disk [vm-disk] Remove unused DataVolume lookup in dv.yaml 2026-04-14 19:59:19 +05:00
vm-instance [vm-instance] Add externalAllowICMP knob, drop in-PR changelog 2026-04-28 08:37:13 +02:00
vpc [docs] Update cozyvalues-gen 2026-03-25 15:59:22 +05:00
vpn feat(platform): add resourcePreset labels 2026-04-17 15:04:25 +04:00
Makefile refactor: move scripts to hack directory 2026-01-15 16:06:56 +01:00
README.md [clickhouse] add clickhouse keeper 2025-08-07 14:07:05 +03:00

How to test packages local

cd packages/core/installer
make image-cozystack REGISTRY=YOUR_CUSTOM_REGISTRY
make apply
kubectl delete po -l app=source-controller -n cozy-fluxcd