func (r *ReconcileRethinkDBCluster) reconcilePersistentVolumeClaims(cr *rethinkdbv1alpha1.RethinkDBCluster) error {
	if !isPVEnabled(cr) {
		return nil
	}

	pvcs, err := r.listPVCs(cr)
	if err != nil {
		log.Error(err, "unable to list persistent volume claims")
		return err
	}
	pvcCount := int32(len(pvcs))

	if pvcCount < cr.Spec.Size {
		return r.addPVC(cr)
	} else if pvcCount > cr.Spec.Size {
		return r.removePVC(cr, pvcs)
	}

	log.Info("correct persistent volume claim count reached", "count", pvcCount)
	return nil
}
// reconcilePersistentVolumeClaims ensures the requested number of PVCs are created.
reconcilePersistentVolumeClaims ensures the requested number of PVCs are created.
// reconcilePersistentVolumeClaims ensures the requested number of PVCs are created .
func (r *ReconcileRethinkDBCluster) reconcilePersistentVolumeClaims(cr *rethinkdbv1alpha1.RethinkDBCluster) error {
	if !isPVEnabled(cr) {
		return nil
	}
	pvcs, err := r.listPVCs(cr)
	if err != nil {
		log.Error(err, "unable to list persistent volume claims")
		return err
	}
	pvcCount := int32(len(pvcs))
	if pvcCount < cr.Spec.Size {
		return r.addPVC(cr)
	} else if pvcCount > cr.Spec.Size {
		return r.removePVC(cr, pvcs)
	}
	log.Info("correct persistent volume claim count reached", "count", pvcCount)
	return nil
}
func ( r * ReconcileRethinkDBCluster ) reconcilePersistentVolumeClaims ( cr * rethinkdbv1alpha1 . RethinkDBCluster ) error { if ! isPVEnabled ( cr ) { return nil } pvcs , err := r . listPVCs ( cr ) if err != nil { log . Error ( err , " " ) return err } pvcCount := int32 ( len ( pvcs ) ) if pvcCount < cr . Spec . Size { return r . addPVC ( cr ) } else if pvcCount > cr . Spec . Size { return r . removePVC ( cr , pvcs ) } log . Info ( " " , " " , pvcCount ) return nil }
reconcilePersistentVolumeClaims ensures the requested number of PVCs are created.
reconcilePersistentVolumeClaims ensures the requested number of PVCs are created .