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, )
| 427 | |
| 428 | // InstanceCertificates populates the shared Secret with certificates needed to run pgBackRest. |
| 429 | func 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 |
no test coverage detected