-
Notifications
You must be signed in to change notification settings - Fork 248
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
Support multi-stage imports in import populator #2767
Support multi-stage imports in import populator #2767
Conversation
Skipping CI for Draft Pull Request. |
/test pull-containerized-data-importer-e2e-ceph |
603e6c4
to
81aa294
Compare
22b0df3
to
e0cdedb
Compare
/retest-required |
e0cdedb
to
a4225f5
Compare
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.
looks pretty good! Some minor comments
staging/src/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1/types.go
Outdated
Show resolved
Hide resolved
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.
Over all looks good! some comments and need to add some tests and UT
staging/src/kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1/types.go
Show resolved
Hide resolved
case string(corev1.PodFailed): | ||
// We'll get called later once it succeeds | ||
r.recorder.Eventf(pvc, corev1.EventTypeWarning, importFailed, messageImportFailed, pvc.Name) | ||
case string(corev1.PodSucceeded): | ||
if _, multiStageInProgress = pvc.Annotations[cc.AnnCurrentCheckpoint]; multiStageInProgress { |
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.
maybe put this in a function since you use it twice and it will be cleaner?
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.
Sure.
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.
After adding the change I think it's a little bit unintuitive to have a function for this (sometimes I want the value, sometimes I don't). If it's not a must I'll leave the annotation as check as it is.
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.
Had to fix a bug involving this annotation so ended up following your suggestion.
a4225f5
to
cde28c5
Compare
cde28c5
to
83942fe
Compare
This commit modifies the VolumeImportSource API to support multi-stage imports, adding the following fields: - Checkpoints, to represent the stages of a multistage import - TargetClaim, the name of the specific PVC to be imported - FinalCheckpoint, to indicate that the current Checkpoint is the final one Signed-off-by: Alvaro Romero <alromero@redhat.com>
This commit updates the import populator to support multi-stage imports. The API and functionality remains the same as with DataVolumes, with the only difference that the used VolumeImportSource will now require a populated "TargetClaim" field that reffers to the specific PVC to be populated. The DataVolume controller is also updated to allow using the populator flow with VDDK and ImageIO sources. Signed-off-by: Alvaro Romero <alromero@redhat.com>
83942fe
to
442ae5c
Compare
442ae5c
to
7566617
Compare
@@ -1119,7 +1119,7 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]DataVolume tests", | |||
size: "1Gi", | |||
url: vcenterURL, | |||
dvFunc: createVddkDataVolume, | |||
eventReason: common.AwaitingVDDK, | |||
eventReason: "Pending", |
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.
Note for the reviewer: I changed this eventReason
to pending since with populators, DataVolumes won't get boundCondition events.
c0d2b61
to
95c04c9
Compare
3d7dded
to
b4fb700
Compare
@mhenriks @ShellyKa13 I hopefully just fixed the last major bug here, would appreciate more reviews :) |
Signed-off-by: Alvaro Romero <alromero@redhat.com>
Signed-off-by: Alvaro Romero <alromero@redhat.com>
This commit fixes several bugs in the import-populator logic for multi-stage imports. Signed-off-by: Alvaro Romero <alromero@redhat.com>
b4fb700
to
814b25d
Compare
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.
looks great! small question just to make sure, giving lgtm anyways if the question is irrelevant :)
/lgtm
if isMultiStage { | ||
importSource.Spec.TargetClaim = &dv.Name | ||
importSource.Spec.Checkpoints = dv.Spec.Checkpoints | ||
importSource.Spec.FinalCheckpoint = &dv.Spec.FinalCheckpoint |
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.
just making sure FinalCheckpoint cant be 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.
Yeah it can be nil, but it's always checked before dereferencing (and, in that case, we assume its value to be false)
/hold I think everything is fixed but let's see how well tests behave. I've been struggling with some racy behavior. |
/test pull-containerized-data-importer-e2e-istio |
I'm confident this is working |
/approve |
[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 |
What this PR does / why we need it:
This Pull Request aims to update the import populator to support multi-stage imports.
The API and functionality remain the same as with DataVolumes, with the only difference being that the used VolumeImportSource will now require a populated
TargetClaim
field that refers to the specific PVC to be imported (only mandatory in multistage imports).For more information: https://github.com/kubevirt/containerized-data-importer/blob/main/doc/datavolumes.md#multi-stage-import
Special notes for your reviewer:
Release note: