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

Function InstanceCertificates

internal/patroni/reconcile.go:66–80  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

64
65// InstanceCertificates populates the shared Secret with certificates needed to run Patroni.
66func InstanceCertificates(ctx context.Context,
67 inRoot pki.Certificate, inDNS pki.Certificate,
68 inDNSKey pki.PrivateKey, outInstanceCertificates *corev1.Secret,
69) error {
70 initialize.Map(&outInstanceCertificates.Data)
71
72 var err error
73 outInstanceCertificates.Data[certAuthorityFileKey], err = certFile(inRoot)
74
75 if err == nil {
76 outInstanceCertificates.Data[certServerFileKey], err = certFile(inDNSKey, inDNS)
77 }
78
79 return err
80}
81
82// InstancePod populates a PodTemplateSpec with the fields needed to run Patroni.
83// The database container must already be in the template.

Calls 2

MapFunction · 0.92
certFileFunction · 0.70

Tested by 1