func NewEtcdCASecret(e *v1alpha1.EtcdCluster) (*corev1.Secret, error) {
	caCrt, caKey, err := GenerateSelfSignedCACertAndKey(e.Name)
	if err != nil {
		return nil, err
	}
	secret := &corev1.Secret{
		ObjectMeta: v1.ObjectMeta{
			Namespace: e.Namespace,
			Name:      NameForEtcdCertSecret(e.Name, EtcdCACert),
		},
		Data: map[string][]byte{
			EtcdCACertName: caCrt,
			EtcdCAKeyName:  caKey,
		},
	}
	controller.SetEtcdOwnerReference(&secret.ObjectMeta, e)

	return secret, nil
}
// NewEtcdCASecret return a secret which contains a self-signed etcd ca cert and key
NewEtcdCASecret return a secret which contains a self-signed etcd ca cert and key
// NewEtcdCASecret return a secret which contains a self - signed etcd ca cert and key
func NewEtcdCASecret(e *v1alpha1.EtcdCluster) (*corev1.Secret, error) {
	caCrt, caKey, err := GenerateSelfSignedCACertAndKey(e.Name)
	if err != nil {
		return nil, err
	}
	secret := &corev1.Secret{
		ObjectMeta: v1.ObjectMeta{
			Namespace: e.Namespace,
			Name:      NameForEtcdCertSecret(e.Name, EtcdCACert),
		},
		Data: map[string][]byte{
			EtcdCACertName: caCrt,
			EtcdCAKeyName:  caKey,
		},
	}
	controller.SetEtcdOwnerReference(&secret.ObjectMeta, e)
	return secret, nil
}
func NewEtcdCASecret ( e * v1alpha1 . EtcdCluster ) ( * corev1 . Secret , error ) { caCrt , caKey , err := GenerateSelfSignedCACertAndKey ( e . Name ) if err != nil { return nil , err } secret := & corev1 . Secret { ObjectMeta : v1 . ObjectMeta { Namespace : e . Namespace , Name : NameForEtcdCertSecret ( e . Name , EtcdCACert ) , } , Data : map [ string ] [ ] byte { EtcdCACertName : caCrt , EtcdCAKeyName : caKey , } , } controller . SetEtcdOwnerReference ( & secret . ObjectMeta , e ) return secret , nil }
NewEtcdCASecret return a secret which contains a self-signed etcd ca cert and key
NewEtcdCASecret return a secret which contains a self - signed etcd ca cert and key