// NewMySQLCluster is a helper func that creates a mysql cluster
NewMySQLCluster is a helper func that creates a mysql cluster
// NewMySQLCluster is a helper func that creates a mysql cluster
func NewMySQLCluster(opts ...MySQLClusterOption) *mysqlv1alpha1.MysqlCluster {
	name := fmt.Sprintf("cluster-%d", rand.Int31())
	mc := &mysqlv1alpha1.MysqlCluster{
		ObjectMeta: metav1.ObjectMeta{
			Namespace: "default",
			Name:      name,
			Labels:    map[string]string{},
		},
		Spec: mysqlv1alpha1.MysqlClusterSpec{
			SecretName: name,
			PodSpec: mysqlv1alpha1.PodSpec{
				Resources: corev1.ResourceRequirements{
					Limits:   corev1.ResourceList{},
					Requests: corev1.ResourceList{},
				},
			},
			VolumeSpec: mysqlv1alpha1.VolumeSpec{
				PersistentVolumeClaim: &corev1.PersistentVolumeClaimSpec{
					Resources: corev1.ResourceRequirements{
						Limits:   corev1.ResourceList{},
						Requests: corev1.ResourceList{},
					},
				},
			},
		},
	}
	for _, opt := range opts {
		Expect(opt(mc)).To(Succeed())
	}
	return mc
}
func NewMySQLCluster ( opts ... MySQLClusterOption ) * mysqlv1alpha1 . MysqlCluster { name := fmt . Sprintf ( " " , rand . Int31 ( ) ) mc := & mysqlv1alpha1 . MysqlCluster { ObjectMeta : metav1 . ObjectMeta { Namespace : " " , Name : name , Labels : map [ string ] string { } , } , Spec : mysqlv1alpha1 . MysqlClusterSpec { SecretName : name , PodSpec : mysqlv1alpha1 . PodSpec { Resources : corev1 . ResourceRequirements { Limits : corev1 . ResourceList { } , Requests : corev1 . ResourceList { } , } , } , VolumeSpec : mysqlv1alpha1 . VolumeSpec { PersistentVolumeClaim : & corev1 . PersistentVolumeClaimSpec { Resources : corev1 . ResourceRequirements { Limits : corev1 . ResourceList { } , Requests : corev1 . ResourceList { } , } , } , } , } , } for _ , opt := range opts { Expect ( opt ( mc ) ) . To ( Succeed ( ) ) } return mc }
NewMySQLCluster is a helper func that creates a mysql cluster
NewMySQLCluster is a helper func that creates a mysql cluster