func newContainers(cr *v1alpha1.RethinkDBCluster, peers []string) []corev1.Container {
	return []corev1.Container{{
		Command: generateCommand(cr, peers),
		Env: []corev1.EnvVar{{
			Name: RethinkDBPasswordEnv,
			ValueFrom: &corev1.EnvVarSource{
				SecretKeyRef: &corev1.SecretKeySelector{
					LocalObjectReference: corev1.LocalObjectReference{Name: fmt.Sprintf("%s-%s", cr.ObjectMeta.Name, RethinkDBAdminKey)},
					Key:                  RethinkDBPasswordKey,
				},
			},
		}},
		Image: fmt.Sprintf("%s:%s", RethinkDBImage, cr.Spec.Version),
		LivenessProbe: &corev1.Probe{
			Handler: corev1.Handler{
				TCPSocket: &corev1.TCPSocketAction{Port: intstr.FromInt(RethinkDBDriverPort)},
			},
		},
		Name: RethinkDBApp,
		Ports: []corev1.ContainerPort{
			{
				ContainerPort: RethinkDBClusterPort,
				Name:          RethinkDBClusterKey,
			},
			{
				ContainerPort: RethinkDBDriverPort,
				Name:          RethinkDBDriverKey,
			},
			{
				ContainerPort: RethinkDBHttpPort,
				Name:          RethinkDBHttpKey,
			}},
		ReadinessProbe: &corev1.Probe{
			Handler: corev1.Handler{
				TCPSocket: &corev1.TCPSocketAction{Port: intstr.FromInt(RethinkDBDriverPort)},
			},
		},
		Resources: newContainerResources(cr),
		Stdin:     true,
		TTY:       true,
		VolumeMounts: []corev1.VolumeMount{
			{
				Name:      RethinkDBDataKey,
				MountPath: RethinkDBDataPath,
			},
			{
				Name:      RethinkDBTLSSecretsKey,
				MountPath: RethinkDBTLSPath,
			}},
	}}
}
// newContainers will create the Containers for the RethinkDB Pod.
newContainers will create the Containers for the RethinkDB Pod.
// newContainers will create the Containers for the RethinkDB Pod .
func newContainers(cr *v1alpha1.RethinkDBCluster, peers []string) []corev1.Container {
	return []corev1.Container{{
		Command: generateCommand(cr, peers),
		Env: []corev1.EnvVar{{
			Name: RethinkDBPasswordEnv,
			ValueFrom: &corev1.EnvVarSource{
				SecretKeyRef: &corev1.SecretKeySelector{
					LocalObjectReference: corev1.LocalObjectReference{Name: fmt.Sprintf("%s-%s", cr.ObjectMeta.Name, RethinkDBAdminKey)},
					Key:                  RethinkDBPasswordKey,
				},
			},
		}},
		Image: fmt.Sprintf("%s:%s", RethinkDBImage, cr.Spec.Version),
		LivenessProbe: &corev1.Probe{
			Handler: corev1.Handler{
				TCPSocket: &corev1.TCPSocketAction{Port: intstr.FromInt(RethinkDBDriverPort)},
			},
		},
		Name: RethinkDBApp,
		Ports: []corev1.ContainerPort{
			{
				ContainerPort: RethinkDBClusterPort,
				Name:          RethinkDBClusterKey,
			},
			{
				ContainerPort: RethinkDBDriverPort,
				Name:          RethinkDBDriverKey,
			},
			{
				ContainerPort: RethinkDBHttpPort,
				Name:          RethinkDBHttpKey,
			}},
		ReadinessProbe: &corev1.Probe{
			Handler: corev1.Handler{
				TCPSocket: &corev1.TCPSocketAction{Port: intstr.FromInt(RethinkDBDriverPort)},
			},
		},
		Resources: newContainerResources(cr),
		Stdin:     true,
		TTY:       true,
		VolumeMounts: []corev1.VolumeMount{
			{
				Name:      RethinkDBDataKey,
				MountPath: RethinkDBDataPath,
			},
			{
				Name:      RethinkDBTLSSecretsKey,
				MountPath: RethinkDBTLSPath,
			}},
	}}
}
func newContainers ( cr * v1alpha1 . RethinkDBCluster , peers [ ] string ) [ ] corev1 . Container { return [ ] corev1 . Container { { Command : generateCommand ( cr , peers ) , Env : [ ] corev1 . EnvVar { { Name : RethinkDBPasswordEnv , ValueFrom : & corev1 . EnvVarSource { SecretKeyRef : & corev1 . SecretKeySelector { LocalObjectReference : corev1 . LocalObjectReference { Name : fmt . Sprintf ( " " , cr . ObjectMeta . Name , RethinkDBAdminKey ) } , Key : RethinkDBPasswordKey , } , } , } } , Image : fmt . Sprintf ( " " , RethinkDBImage , cr . Spec . Version ) , LivenessProbe : & corev1 . Probe { Handler : corev1 . Handler { TCPSocket : & corev1 . TCPSocketAction { Port : intstr . FromInt ( RethinkDBDriverPort ) } , } , } , Name : RethinkDBApp , Ports : [ ] corev1 . ContainerPort { { ContainerPort : RethinkDBClusterPort , Name : RethinkDBClusterKey , } , { ContainerPort : RethinkDBDriverPort , Name : RethinkDBDriverKey , } , { ContainerPort : RethinkDBHttpPort , Name : RethinkDBHttpKey , } } , ReadinessProbe : & corev1 . Probe { Handler : corev1 . Handler { TCPSocket : & corev1 . TCPSocketAction { Port : intstr . FromInt ( RethinkDBDriverPort ) } , } , } , Resources : newContainerResources ( cr ) , Stdin : true , TTY : true , VolumeMounts : [ ] corev1 . VolumeMount { { Name : RethinkDBDataKey , MountPath : RethinkDBDataPath , } , { Name : RethinkDBTLSSecretsKey , MountPath : RethinkDBTLSPath , } } , } } }
newContainers will create the Containers for the RethinkDB Pod.
newContainers will create the Containers for the RethinkDB Pod .