// CreateMySQLClusterSecret is the option for creating mysql cluster secret
CreateMySQLClusterSecret is the option for creating mysql cluster secret
// CreateMySQLClusterSecret is the option for creating mysql cluster secret
func CreateMySQLClusterSecret(c client.Client, secret *corev1.Secret) MySQLClusterOption {
	return func(mc *mysqlv1alpha1.MysqlCluster) error {
		if secret == nil {
			return errors.New("secret may not be nil")
		}
		if secret.ObjectMeta.Name == "" {
			secret.ObjectMeta.Name = mc.Spec.SecretName
			secret.ObjectMeta.Namespace = mc.ObjectMeta.Namespace
		}
		secret.Type = corev1.SecretTypeOpaque
		secret.StringData = map[string]string{
			"ROOT_PASSWORD": "password",
		}
		return c.Create(context.TODO(), secret)
	}
}
func CreateMySQLClusterSecret ( c client . Client , secret * corev1 . Secret ) MySQLClusterOption { return func ( mc * mysqlv1alpha1 . MysqlCluster ) error { if secret == nil { return errors . New ( " " ) } if secret . ObjectMeta . Name == " " { secret . ObjectMeta . Name = mc . Spec . SecretName secret . ObjectMeta . Namespace = mc . ObjectMeta . Namespace } secret . Type = corev1 . SecretTypeOpaque secret . StringData = map [ string ] string { " " : " " , } return c . Create ( context . TODO ( ) , secret ) } }
CreateMySQLClusterSecret is the option for creating mysql cluster secret
CreateMySQLClusterSecret is the option for creating mysql cluster secret