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, )
| 64 | |
| 65 | // InstanceCertificates populates the shared Secret with certificates needed to run Patroni. |
| 66 | func 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. |