Skip to content

Commit

Permalink
reclaimspace: fix schedule handling
Browse files Browse the repository at this point in the history
This commit addresses a bug in `determineScheduleAndRequeue`
where the check for schedule from the StorageClass annotations
is never reached.

Signed-off-by: Praveen M <[email protected]>
  • Loading branch information
iPraveenParihar committed Jun 26, 2024
1 parent d8727ec commit a2439ac
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions controllers/csiaddons/persistentvolumeclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,22 @@ func (r *PersistentVolumeClaimReconciler) determineScheduleAndRequeue(
return "", err
}
schedule, scheduleFound = getScheduleFromAnnotation(logger, ns.Annotations)
if !scheduleFound {
return "", ErrScheduleNotFound
}

// If the schedule is found, check whether driver supports the
// space reclamation using annotation on namespace and registered driver
// capability for decision on requeue.

requeue, supportReclaimspace := r.checkDriverSupportReclaimsSpace(logger, ns.Annotations, driverName)
if supportReclaimspace {
// if driver supports space reclamation,
// return schedule from ns annotation.
return schedule, nil
}
if requeue {
// The request needs to be requeued for checking
// driver support again.
return "", ErrConnNotFoundRequeueNeeded
if scheduleFound {
requeue, supportReclaimspace := r.checkDriverSupportReclaimsSpace(logger, ns.Annotations, driverName)
if supportReclaimspace {
// if driver supports space reclamation,
// return schedule from ns annotation.
return schedule, nil
}
if requeue {
// The request needs to be requeued for checking
// driver support again.
return "", ErrConnNotFoundRequeueNeeded
}
}

// check for storageclass schedule annotation.
Expand Down

0 comments on commit a2439ac

Please sign in to comment.