func CredentialFromSecret(secret *corev1.Secret) *Credential {
	cred := &Credential{}
	username, ok := secret.Data["username"]
	if !ok {
		return nil
	}
	cred.Username = string(username)

	password, ok := secret.Data["password"]
	if !ok {
		return nil
	}
	cred.Password = string(password)

	return cred
}
// CredentialFromSecret get the credential used by operator to access etcd cluster,
// return nil if the credential is invalid
CredentialFromSecret get the credential used by operator to access etcd cluster,
return nil if the credential is invalid
// CredentialFromSecret get the credential used by operator to access etcd cluster // return nil if the credential is invalid
func CredentialFromSecret(secret *corev1.Secret) *Credential {
	cred := &Credential{}
	username, ok := secret.Data["username"]
	if !ok {
		return nil
	}
	cred.Username = string(username)
	password, ok := secret.Data["password"]
	if !ok {
		return nil
	}
	cred.Password = string(password)
	return cred
}
func CredentialFromSecret ( secret * corev1 . Secret ) * Credential { cred := & Credential { } username , ok := secret . Data [ " " ] if ! ok { return nil } cred . Username = string ( username ) password , ok := secret . Data [ " " ] if ! ok { return nil } cred . Password = string ( password ) return cred }
CredentialFromSecret get the credential used by operator to access etcd cluster,
return nil if the credential is invalid
CredentialFromSecret get the credential used by operator to access etcd cluster return nil if the credential is invalid