MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / AddServerToRepoPod

Function AddServerToRepoPod

internal/pgbackrest/reconcile.go:407–426  ·  view source on GitHub ↗

AddServerToRepoPod adds the TLS server container and volume to pod for the dedicated repository host of cluster.

(
	ctx context.Context,
	cluster *v1beta1.PostgresCluster, pod *corev1.PodSpec,
)

Source from the content-addressed store, hash-verified

405// AddServerToRepoPod adds the TLS server container and volume to pod for
406// the dedicated repository host of cluster.
407func AddServerToRepoPod(
408 ctx context.Context,
409 cluster *v1beta1.PostgresCluster, pod *corev1.PodSpec,
410) {
411 certificates := []corev1.VolumeProjection{{
412 Secret: &corev1.SecretProjection{
413 LocalObjectReference: corev1.LocalObjectReference{
414 Name: naming.PGBackRestSecret(cluster).Name,
415 },
416 Items: repositoryServerCertificates(),
417 },
418 }}
419
420 var resources *corev1.ResourceRequirements
421 if cluster.Spec.Backups.PGBackRest.RepoHost != nil {
422 resources = &cluster.Spec.Backups.PGBackRest.RepoHost.Resources
423 }
424
425 addServerContainerAndVolume(ctx, cluster, pod, certificates, resources)
426}
427
428// InstanceCertificates populates the shared Secret with certificates needed to run pgBackRest.
429func InstanceCertificates(ctx context.Context,

Callers 2

TestAddServerToRepoPodFunction · 0.85

Calls 3

PGBackRestSecretFunction · 0.92

Tested by 1

TestAddServerToRepoPodFunction · 0.68