A CNPG restore took the destination path and endpoint of the source
from the Backup artifact but the credentials Secret, its key names and
the endpoint CA from the strategy as it reads at restore time. Once the
strategy pointed at another bucket or endpoint, the restore combined the
recorded location with access settings meant for a different one, and
recovery failed after an in-place restore had already purged the target
Cluster.
The destination record on the cnpg.io/Backup now also carries the key
names and the CA, and the artifact copies them. A restore uses them once
the strategy points elsewhere and their Secrets still hold the keys;
otherwise it keeps the strategy's access, as before, which credentials
wider than one bucket can still read the old archive with. While the
strategy points at the same endpoint and bucket its own access is kept:
WAL archiving keeps proving it against that archive, and it carries any
rotation since the backup, after which the recorded Secret may already
be revoked. The size probe reads the recorded access too. An unreadable
record fails the restore before the purge instead of falling back.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>