Skip to content

Commit

Permalink
reclaimspace: consider VA object only it is attached & not being deleted
Browse files Browse the repository at this point in the history
This commit makes modification to ignore Volume Attachment objects
which are being deleted or not attached.

Signed-off-by: Rakshith R <[email protected]>
  • Loading branch information
Rakshith-R authored and mergify[bot] committed Jan 2, 2023
1 parent 97912f9 commit 4dda11c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/csiaddons/reclaimspacejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func (r *ReclaimSpaceJobReconciler) getTargetDetails(
pvName: pv.Name,
}
for _, v := range volumeAttachments.Items {
if *v.Spec.Source.PersistentVolumeName == pv.Name {
if v.DeletionTimestamp.IsZero() && v.Status.Attached && *v.Spec.Source.PersistentVolumeName == pv.Name {
*logger = logger.WithValues("NodeID", v.Spec.NodeName)
details.nodeID = v.Spec.NodeName
break
Expand Down

0 comments on commit 4dda11c

Please sign in to comment.