-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove datavolume clone source validation (#3331)
* 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 <[email protected]> * 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 <[email protected]> * Move function to new Describe node Will add in future commits other tests to that section Signed-off-by: Shelly Kagan <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> * 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 <[email protected]> --------- Signed-off-by: Shelly Kagan <[email protected]>
- Loading branch information
1 parent
5063ec6
commit 8dab107
Showing
14 changed files
with
500 additions
and
598 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.