-
Notifications
You must be signed in to change notification settings - Fork 267
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
Improve handling of prePopulated DV #2205
Conversation
Both tests fail on:
|
/test pull-containerized-data-importer-e2e-k8s-1.22-hpp |
Can you give an example of the bug/issue addressed here? Is it simply that a "pre populated" DV may exist but the PVC may not yet? What will be the DV status in that case? |
the case is as follows (happens when restoring DV + PVC using velero but I suppose ):
I think in such case it should mark DV as Pending and wait for PVC |
Previously, when a DataVolume was Reconciled then CDI created PVC regardless of prePopulated annotation. There is a possibility that DataVolume and PVC pair is being restored or moved from other cluster. When DataVolume is marked as prePopulated, the CDI should not try to populate it. Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
9a17513
to
588e826
Compare
/test pull-containerized-data-importer-e2e-k8s-1.22-upg |
/test pull-containerized-data-importer-e2e-k8s-1.21-hpp |
/test pull-containerized-data-importer-e2e-k8s-1.21-hpp |
/test pull-containerized-data-importer-e2e-k8s-1.22-hpp |
lets try If CI is up |
/test pull-containerized-data-importer-e2e-k8s-1.21-hpp |
/test pull-containerized-data-importer-e2e-k8s-1.22-upg |
if err := r.setCloneOfOnPvc(pvc); err != nil { | ||
switch selectedCloneStrategy { | ||
case HostAssistedClone: | ||
if err := r.ensureExtendedToken(pvc); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR does a good job of handling the case where a DV has "pre populated" annotation and the PVC does not exist. But it appears we have to better handle the case where the PVC has "populated for".
This bug has more details: https://bugzilla.redhat.com/show_bug.cgi?id=2070366
Basically, the controller sees "populated for", takes ownership of the PVC, but still gets to this ensureExtendedToken
call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want me to handle the problem with this PR, or create a new PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the logic, now I need to prepare a test so this can be confirmed,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the tests
20934bd
to
7b4d1e2
Compare
I think current version will work but I suppose it can be written with a better style |
/retest |
7b4d1e2
to
a5b2bf4
Compare
Updated the logic to cover DV and PVC, also added a test that failed on previous logic on host assisted clone and also on csi clone. There is only one problem left. If I try to write a test without adding a
|
a5b2bf4
to
200b5c5
Compare
Ok, that is bad. I know what to do. |
200b5c5
to
588e826
Compare
@@ -122,7 +122,7 @@ func updateReadyCondition(conditions []cdiv1.DataVolumeCondition, status corev1. | |||
} | |||
|
|||
func updateBoundCondition(conditions []cdiv1.DataVolumeCondition, pvc *corev1.PersistentVolumeClaim, reason string) []cdiv1.DataVolumeCondition { | |||
if pvc != nil { | |||
if pvc != nil && pvc.Name != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would a PVC not have a name? PVC is used after client returns notfound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the beginning of main reconcile loop we do pvc := &corev1.PersistentVolumeClaim{}
to get the PVC.
If it is not found we have an empty PVC with no name.
I can make it null, but I would need to carefully check if all the code is ready for null. This needs to be improved, and I'll try to clean up on the next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is pretty ugly, please handle in #2227
/retest |
1 similar comment
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mhenriks The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-containerized-data-importer-e2e-k8s-1.22-hpp-istio |
/cherrypick release-v1.43 |
/cherrypick release-v1.43 |
@brybacki: new pull request created: #2322 In response to this:
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. |
@brybacki: new pull request could not be created: failed to create pull request against kubevirt/containerized-data-importer#release-v1.43 from head kubevirt-bot:cherry-pick-2205-to-release-v1.43: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for kubevirt-bot:cherry-pick-2205-to-release-v1.43."}],"documentation_url":"https://docs.github.com/rest/reference/pulls#create-a-pull-request"} In response to this:
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. |
/cherrypick release-v1.49 |
@aglitke: #2205 failed to apply on top of branch "release-v1.49":
In response to this:
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. |
Oops. This is already on release-v1.49 |
Signed-off-by: Bartosz Rybacki brybacki@redhat.com
What this PR does / why we need it:
Previously, when a DataVolume was Reconciled then CDI created PVC
regardless of prePopulated annotation.
There is a possibility that DataVolume and PVC pair is being
restored or moved from other cluster. When DataVolume is marked
as prePopulated, the CDI should not try to populate it.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: