Skip to content

Commit

Permalink
vrg: cleanup rd when vrg is secondary
Browse files Browse the repository at this point in the history
In processForDeletion, we cleanup the resources that are related to
volsync. It relies on v.volSyncPVCs but the list is empty when the vrg
is secondary because it is populated by looking at the
vrg.status.ProtectedPVCs.

For managed applications, the RD,RS and Snapshots were being as a
consequence of the deletion of VRG as the VRG is the owner for them.

In the case of discovered apps, the vrg is not the owner and therefore
the RD was being left behind.

Co-Authored-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Raghavendra Talur <[email protected]>
  • Loading branch information
raghavendra-talur and asn1809 committed Jan 7, 2025
1 parent 638d31e commit 80df802
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/controller/vrg_volsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,5 +566,13 @@ func (v *VRGInstance) cleanupResources() error {
}
}

for idx := range v.instance.Spec.VolSync.RDSpec {
pvc := v.instance.Spec.VolSync.RDSpec[idx].ProtectedPVC

if err := v.volSyncHandler.DeleteRD(pvc.Name, pvc.Namespace); err != nil {
return err
}
}

return nil
}

0 comments on commit 80df802

Please sign in to comment.