func MysqlPodDef(cr *cachev1alpha1.Mysql) *corev1.Pod {
	labels := map[string]string{
		"app": cr.Name,
	}
	mysqlEnvVars := cr.Spec.Environment
	return &corev1.Pod{
		ObjectMeta: metav1.ObjectMeta{
			Name:      cr.Name + "-pod",
			Namespace: cr.Namespace,
			Labels:    labels,
		},
		Spec: corev1.PodSpec{
			Containers: []corev1.Container{
				{
					Name:    "busybox",
					Image:   "quay.io/sher_chowdhury0/busybox:latest",
					Command: []string{"sleep", "3600"},
					Env: []corev1.EnvVar{
						{
							Name:  "MYSQL_ROOT_PASSWORD",
							Value: mysqlEnvVars.MysqlRootPassword,
						},
						{
							Name:  "MYSQL_DATABASE",
							Value: mysqlEnvVars.MysqlDatabase,
						},
						{
							Name:  "MYSQL_USER",
							Value: mysqlEnvVars.MysqlUser,
						},
						{
							Name:  "MYSQL_PASSWORD",
							Value: mysqlEnvVars.MysqlPassword,
						},
					},
				},
			},
		},
	}
}
// newPodForCR returns a busybox pod with the same name/namespace as the cr
newPodForCR returns a busybox pod with the same name/namespace as the cr
// newPodForCR returns a busybox pod with the same name / namespace as the cr
func MysqlPodDef(cr *cachev1alpha1.Mysql) *corev1.Pod {
	labels := map[string]string{
		"app": cr.Name,
	}
	mysqlEnvVars := cr.Spec.Environment
	return &corev1.Pod{
		ObjectMeta: metav1.ObjectMeta{
			Name:      cr.Name + "-pod",
			Namespace: cr.Namespace,
			Labels:    labels,
		},
		Spec: corev1.PodSpec{
			Containers: []corev1.Container{
				{
					Name:    "busybox",
					Image:   "quay.io/sher_chowdhury0/busybox:latest",
					Command: []string{"sleep", "3600"},
					Env: []corev1.EnvVar{
						{
							Name:  "MYSQL_ROOT_PASSWORD",
							Value: mysqlEnvVars.MysqlRootPassword,
						},
						{
							Name:  "MYSQL_DATABASE",
							Value: mysqlEnvVars.MysqlDatabase,
						},
						{
							Name:  "MYSQL_USER",
							Value: mysqlEnvVars.MysqlUser,
						},
						{
							Name:  "MYSQL_PASSWORD",
							Value: mysqlEnvVars.MysqlPassword,
						},
					},
				},
			},
		},
	}
}
func MysqlPodDef ( cr * cachev1alpha1 . Mysql ) * corev1 . Pod { labels := map [ string ] string { " " : cr . Name , } mysqlEnvVars := cr . Spec . Environment return & corev1 . Pod { ObjectMeta : metav1 . ObjectMeta { Name : cr . Name + " " , Namespace : cr . Namespace , Labels : labels , } , Spec : corev1 . PodSpec { Containers : [ ] corev1 . Container { { Name : " " , Image : " " , Command : [ ] string { " " , " " } , Env : [ ] corev1 . EnvVar { { Name : " " , Value : mysqlEnvVars . MysqlRootPassword , } , { Name : " " , Value : mysqlEnvVars . MysqlDatabase , } , { Name : " " , Value : mysqlEnvVars . MysqlUser , } , { Name : " " , Value : mysqlEnvVars . MysqlPassword , } , } , } , } , } , } }
newPodForCR returns a busybox pod with the same name/namespace as the cr
newPodForCR returns a busybox pod with the same name / namespace as the cr