func newCASecret(cr *v1alpha1.RethinkDBCluster, name string) (*corev1.Secret, error) {
	secret := newTLSSecret(cr, name)

	key, err := newPrivateKey()
	if err != nil {
		return nil, err
	}

	cert, err := newSelfSignedCACertificate(key)
	if err != nil {
		return nil, err
	}

	secret.Data = map[string][]byte{
		corev1.TLSCertKey:       encodeCertificatePEM(cert),
		corev1.TLSPrivateKeyKey: encodePrivateKeyPEM(key),
	}

	return secret, nil
}
// newCASecret creates a new CA secret for the given RethinkDBCluster.
newCASecret creates a new CA secret for the given RethinkDBCluster.
// newCASecret creates a new CA secret for the given RethinkDBCluster .
func newCASecret(cr *v1alpha1.RethinkDBCluster, name string) (*corev1.Secret, error) {
	secret := newTLSSecret(cr, name)
	key, err := newPrivateKey()
	if err != nil {
		return nil, err
	}
	cert, err := newSelfSignedCACertificate(key)
	if err != nil {
		return nil, err
	}
	secret.Data = map[string][]byte{
		corev1.TLSCertKey:       encodeCertificatePEM(cert),
		corev1.TLSPrivateKeyKey: encodePrivateKeyPEM(key),
	}
	return secret, nil
}
func newCASecret ( cr * v1alpha1 . RethinkDBCluster , name string ) ( * corev1 . Secret , error ) { secret := newTLSSecret ( cr , name ) key , err := newPrivateKey ( ) if err != nil { return nil , err } cert , err := newSelfSignedCACertificate ( key ) if err != nil { return nil , err } secret . Data = map [ string ] [ ] byte { corev1 . TLSCertKey : encodeCertificatePEM ( cert ) , corev1 . TLSPrivateKeyKey : encodePrivateKeyPEM ( key ) , } return secret , nil }
newCASecret creates a new CA secret for the given RethinkDBCluster.
newCASecret creates a new CA secret for the given RethinkDBCluster .