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

Method loadCluster

pkg/management/postgres/restore.go:469–477  ·  view source on GitHub ↗

loadCluster loads the cluster definition from the API server

(ctx context.Context, typedClient client.Client)

Source from the content-addressed store, hash-verified

467
468// loadCluster loads the cluster definition from the API server
469func (info InitInfo) loadCluster(ctx context.Context, typedClient client.Client) (*apiv1.Cluster, error) {
470 var cluster apiv1.Cluster
471 err := typedClient.Get(ctx, client.ObjectKey{Namespace: info.Namespace, Name: info.ClusterName}, &cluster)
472 if err != nil {
473 return nil, err
474 }
475
476 return &cluster, nil
477}
478
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

Callers 3

BootstrapMethod · 0.95
RestoreSnapshotMethod · 0.95
RestoreMethod · 0.95

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected