func (r *ReconcileRethinkDBCluster) addServer(cr *rethinkdbv1alpha1.RethinkDBCluster, members []corev1.Pod) error {
	log.Info("creating new server pod")
	pod := newPod(cr, members)

	// Set RethinkDB instance as the owner and controller
	if err := controllerutil.SetControllerReference(cr, pod, r.scheme); err != nil {
		return err
	}

	err := r.client.Create(context.TODO(), pod)
	if err != nil {
		return err
	}

	// Pod created successfully, update status and return
	cr.Status.Servers = append(cr.Status.Servers, pod.Name)
	return r.client.Status().Update(context.TODO(), cr)
}
// addServer will add a new Pod to the cluster.
addServer will add a new Pod to the cluster.
// addServer will add a new Pod to the cluster .
func (r *ReconcileRethinkDBCluster) addServer(cr *rethinkdbv1alpha1.RethinkDBCluster, members []corev1.Pod) error {
	log.Info("creating new server pod")
	pod := newPod(cr, members)
	if err := controllerutil.SetControllerReference(cr, pod, r.scheme); err != nil {
		return err
	}
	err := r.client.Create(context.TODO(), pod)
	if err != nil {
		return err
	}
	cr.Status.Servers = append(cr.Status.Servers, pod.Name)
	return r.client.Status().Update(context.TODO(), cr)
}
func ( r * ReconcileRethinkDBCluster ) addServer ( cr * rethinkdbv1alpha1 . RethinkDBCluster , members [ ] corev1 . Pod ) error { log . Info ( " " ) pod := newPod ( cr , members ) if err := controllerutil . SetControllerReference ( cr , pod , r . scheme ) ; err != nil { return err } err := r . client . Create ( context . TODO ( ) , pod ) if err != nil { return err } cr . Status . Servers = append ( cr . Status . Servers , pod . Name ) return r . client . Status ( ) . Update ( context . TODO ( ) , cr ) }
addServer will add a new Pod to the cluster.
addServer will add a new Pod to the cluster .
// Set RethinkDB instance as the owner and controller // Pod created successfully, update status and return