MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / loadBackup

Method loadBackup

pkg/management/postgres/restore.go:481–492  ·  view source on GitHub ↗

loadBackup loads the backup manifest from the API server of from the object store. It also gets the environment variables that are needed to recover the cluster

(
	ctx context.Context,
	typedClient client.Client,
	cluster *apiv1.Cluster,
)

Source from the content-addressed store, hash-verified

479// loadBackup loads the backup manifest from the API server of from the object store.
480// It also gets the environment variables that are needed to recover the cluster
481func (info InitInfo) loadBackup(
482 ctx context.Context,
483 typedClient client.Client,
484 cluster *apiv1.Cluster,
485) (*apiv1.Backup, []string, error) {
486 // Recovery given an existing backup
487 if cluster.Spec.Bootstrap.Recovery.Backup != nil {
488 return info.loadBackupFromReference(ctx, typedClient, cluster)
489 }
490
491 return info.loadBackupObjectFromExternalCluster(ctx, typedClient, cluster)
492}
493
494// loadBackupObjectFromExternalCluster generates an in-memory Backup structure given a reference to
495// an external cluster, loading the required information from the object store

Callers 1

RestoreMethod · 0.95

Tested by

no test coverage detected