-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow creating clones without source PVC (#2306)
* Modify datavolume admission webhook to enable creating clones without source PVC This commit modifies the datavolume admission webhook to follow a more descriptive approach, enabling the creation of clones without a source PVC. This clone will later be handled by the datavolume-controller until the source PVC is created. Signed-off-by: Alvaro Romero <alromero@redhat.com> * Modify the datavolume-controller to improve the handling of clones without source Since we are allowing the creation of clones without source PVC in the admission webhook, we need to improve the handling of these clones once in the datavolume-controller. This commit modifies said controller, so we do proper error handling and validation until the source PVC is created. Signed-off-by: Alvaro Romero <alromero@redhat.com> * Add unit tests to check the creation of clones without source PVC Signed-off-by: Alvaro Romero <alromero@redhat.com> * Include a mechanism to reconcile clones without source once the source PVC is created This commit introduces a new datavolume-controller watch so, if a clone without source is created, we make sure to reconcile it once a proper PVC is created. It also updates/includes unit tests for proper coverage. Signed-off-by: Alvaro Romero <alromero@redhat.com> * Include functional tests to cover the creation of clones without source PVC Signed-off-by: Alvaro Romero <alromero@redhat.com> * Minor refactoring of clone-related code in DataVolume reconciler to improve readability After enabling the creation of clones without source PVC in the datavolume controller, the clone-related logic outside its reconciler has increased in size and become sparse. This commit rearranges all this code and condenses it into the clone reconciler, without changing the loop behavior. Signed-off-by: Alvaro Romero <alromero@redhat.com> * Modify datavolume-mutate webhook to reject the creation of clones if the source PVC's namespace doesn't exist In previous commits, a mechanism to allow the creation of clones without source PVC was added, without ever checking if the source PVC's namespace exists or not. This behavior could lead to permission conflicts between the user and the source's namespace since the webhook skipped all the related validation. This commit modifies the datavolume-mutate admission webhook to reject the clone if the source PVC's namespace doesn't exist. Signed-off-by: Alvaro Romero <alromero@redhat.com> * Update unit tests for proper coverage of clone-validation functions This commit adds and updates several unit tests to improve the coverage of the clone-validation mechanism after several functions were moved to the controller. It also introduces minor changes on related code in the datavolume-controller and functional tests following PR review. Signed-off-by: Alvaro Romero <alromero@redhat.com>
- Loading branch information
Showing
9 changed files
with
429 additions
and
37 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
Oops, something went wrong.