Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reclaimspace: consider VA object only it is attached & not being deleted #285

Merged
merged 1 commit into from
Jan 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true for controller space reclaim, as PV is not required to be attached, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true for controller space reclaim, as PV is not required to be attached, right?

We don't need node information for performing controller space reclaim.
It will still happen.

*logger = logger.WithValues("NodeID", v.Spec.NodeName)
details.nodeID = v.Spec.NodeName
break
Expand Down