func (r *CSICloneReconciler) Reconcile(req reconcile.Request) (reconcile.Result, error) {
	log := r.log.WithValues("PVC", req.NamespacedName)
	log.Info("reconciling csi clone")
	pvc := &corev1.PersistentVolumeClaim{}
	if err := r.client.Get(context.TODO(), req.NamespacedName, pvc); err != nil {
		if k8serrors.IsNotFound(err) {
			return reconcile.Result{}, nil
		}
		return reconcile.Result{}, err
	}
	isCloneSource := pvc.Annotations[AnnCSICloneSource]
	isCloneTarget := pvc.Annotations[AnnCSICloneTarget]

	if s, err := strconv.ParseBool(isCloneSource); s && err == nil {
		// Reconciling the Source PVC
		return r.reconcileSourcePvc(log, pvc)
	}

	if s, err := strconv.ParseBool(isCloneTarget); s && err == nil {
		// Reconciling the Target PVC
		return r.reconcileTargetPVC(log, pvc)
	}

	return reconcile.Result{}, nil
}
// Reconcile the reconcile loop for csi cloning
Reconcile the reconcile loop for csi cloning
// Reconcile the reconcile loop for csi cloning
func (r *CSICloneReconciler) Reconcile(req reconcile.Request) (reconcile.Result, error) {
	log := r.log.WithValues("PVC", req.NamespacedName)
	log.Info("reconciling csi clone")
	pvc := &corev1.PersistentVolumeClaim{}
	if err := r.client.Get(context.TODO(), req.NamespacedName, pvc); err != nil {
		if k8serrors.IsNotFound(err) {
			return reconcile.Result{}, nil
		}
		return reconcile.Result{}, err
	}
	isCloneSource := pvc.Annotations[AnnCSICloneSource]
	isCloneTarget := pvc.Annotations[AnnCSICloneTarget]
	if s, err := strconv.ParseBool(isCloneSource); s && err == nil {
		return r.reconcileSourcePvc(log, pvc)
	}
	if s, err := strconv.ParseBool(isCloneTarget); s && err == nil {
		return r.reconcileTargetPVC(log, pvc)
	}
	return reconcile.Result{}, nil
}
func ( r * CSICloneReconciler ) Reconcile ( req reconcile . Request ) ( reconcile . Result , error ) { log := r . log . WithValues ( " " , req . NamespacedName ) log . Info ( " " ) pvc := & corev1 . PersistentVolumeClaim { } if err := r . client . Get ( context . TODO ( ) , req . NamespacedName , pvc ) ; err != nil { if k8serrors . IsNotFound ( err ) { return reconcile . Result { } , nil } return reconcile . Result { } , err } isCloneSource := pvc . Annotations [ AnnCSICloneSource ] isCloneTarget := pvc . Annotations [ AnnCSICloneTarget ] if s , err := strconv . ParseBool ( isCloneSource ) ; s && err == nil { return r . reconcileSourcePvc ( log , pvc ) } if s , err := strconv . ParseBool ( isCloneTarget ) ; s && err == nil { return r . reconcileTargetPVC ( log , pvc ) } return reconcile . Result { } , nil }
Reconcile the reconcile loop for csi cloning
Reconcile the reconcile loop for csi cloning
// Reconciling the Source PVC // Reconciling the Target PVC