mirror of
https://github.com/kubevirt/containerized-data-importer.git
synced 2025-06-03 06:30:22 +00:00
![]() * Remove sourceref validation The source can be changed and updated, we want the error to be presented by an event and have the datavolume pending instead of preventing the creation of the datavolume. We are already handling the option of the source not existing yet so lets also handle all the validation in the controller. Signed-off-by: Shelly Kagan <skagan@redhat.com> * Move pvc clone specific functions to pvc-clone-controller Now that the validation is no longer done in the webhook no need for that code to be in the controller common util file. Moved the UT accordingly. Signed-off-by: Shelly Kagan <skagan@redhat.com> * Move function to new Describe node Will add in future commits other tests to that section Signed-off-by: Shelly Kagan <skagan@redhat.com> * pvc-clone-controller: make better event and update dv if validation fails In order to make it more clear that the validation failed we should add the reason of validation failure to the event Added an update watch to the clone controller so if something changes in the source the clone will reconcile. Hence no need to return an error, the reconcile will be triggered if someting will change in the source. Signed-off-by: Shelly Kagan <skagan@redhat.com> * snap-clone: always validate snapshot source This commit adds missing validation due to the remove validation from the dv webhook, but also fixes an existing missing validation in cases where the clone was created before the source. In such case the webhook would not validate the source since it didnt exist yet, and then if the clone happened with populators then we would not validate the source size at all. We should validate the snapshot source before continuing with the clone whether it is populator/legacy clones. Moved all the validation to one function. Updated the event to include the reason for the validation failure and updated dv status accordingly. Signed-off-by: Shelly Kagan <skagan@redhat.com> * Cloner_test: remove clone to small size test The test checks the rejection of the webhook which no longer exists then clone to appropriate size dv which should succeed which is done in any other clone test. Im not adding a test to check the reconcile loop since it is covered in the UT. Signed-off-by: Shelly Kagan <skagan@redhat.com> * tests/datasource: remove wait for pvc Now since we added the validation also in the populators path we are not creating the pvc until the source exists. Signed-off-by: Shelly Kagan <skagan@redhat.com> --------- Signed-off-by: Shelly Kagan <skagan@redhat.com> |
||
---|---|---|
.. | ||
BUILD.bazel | ||
checkpoint-util.go | ||
controller_suite_test.go | ||
runtime-util.go | ||
util_test.go | ||
util.go |