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

Function InstanceCertificates

internal/pgbackrest/reconcile.go:429–447  ·  view source on GitHub ↗

InstanceCertificates populates the shared Secret with certificates needed to run pgBackRest.

(ctx context.Context,
	inCluster *v1beta1.PostgresCluster,
	inRoot pki.Certificate,
	inDNS pki.Certificate, inDNSKey pki.PrivateKey,
	outInstanceCertificates *corev1.Secret,
)

Source from the content-addressed store, hash-verified

427
428// InstanceCertificates populates the shared Secret with certificates needed to run pgBackRest.
429func InstanceCertificates(ctx context.Context,
430 inCluster *v1beta1.PostgresCluster,
431 inRoot pki.Certificate,
432 inDNS pki.Certificate, inDNSKey pki.PrivateKey,
433 outInstanceCertificates *corev1.Secret,
434) error {
435 var err error
436
437 initialize.Map(&outInstanceCertificates.Data)
438
439 if err == nil {
440 outInstanceCertificates.Data[certInstanceSecretKey], err = certFile(inDNS)
441 }
442 if err == nil {
443 outInstanceCertificates.Data[certInstancePrivateKeySecretKey], err = certFile(inDNSKey)
444 }
445
446 return err
447}
448
449// ReplicaCreateCommand returns the command that can initialize the PostgreSQL
450// data directory on an instance from one of cluster's repositories. It returns

Callers 1

Calls 2

MapFunction · 0.92
certFileFunction · 0.70

Tested by

no test coverage detected