migtools / mig-controller

OpenShift Migration Controller
Apache License 2.0
22 stars 42 forks source link

Ensure target PVCs don't have dataSource(Ref) set #1364

Closed awels closed 9 months ago

awels commented 10 months ago

If the source PVC was created using a dataSource(Ref), then directly copying the PVC spec to the target PVC spec would also copy the dataSource(Ref). If the data source no longer exists the migration would fail because the target PVC would not become bound since the datasource was missing. This change ensures that the dataSource(Ref) is always cleared when creating the target PVC.

Also added a bunch of unit tests to the code that appeared to be missing.