-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release-v1.43] Manual backport of 'Allow creating clones without source PVC (#2306)' #2367
[release-v1.43] Manual backport of 'Allow creating clones without source PVC (#2306)' #2367
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
03fb068
to
a8f75fa
Compare
* 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>
a8f75fa
to
c6c7e85
Compare
/retest-required |
@alromeros: The following test failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest-required |
@alromeros did you have to do many manual changes to adapt the 2306 to this release? |
@brybacki Yeah I had to adapt some newer clone-related code to the old datavolume controller. It wasn't a lot but it required some rework. |
/hold As in #2366, holding since we have yet to reach a consensus on whether to backport this feature or not. The general idea seemed to be not doing it, which I'm not against, but I'll leave the PR open for some time just in case. |
@alromeros: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Since #2405 was merged, this backport is no longer necessary. I'm closing the PR. |
What this PR does / why we need it:
Manual backport of #2306
Release note: