-
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 DataVolume status reporting with populators #2928
Conversation
/cc @mhenriks |
I'm wondering how to address the error that's popping up in the tests. There's this specific case where we test a failed import in which the PVC Prime gets bound after the target PVC is updated for the last time. Since we don't trigger reconciles for PVC Prime updates, we don't update the status phase to |
@@ -196,19 +196,37 @@ func isPVCUploadPopulation(pvc *corev1.PersistentVolumeClaim) bool { | |||
return populators.IsPVCDataSourceRefKind(pvc, cdiv1.VolumeUploadSourceRef) | |||
} | |||
|
|||
func (r *UploadReconciler) shouldUpdateStatusPhase(pvc *corev1.PersistentVolumeClaim, dv *cdiv1.DataVolume) (bool, error) { |
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.
Is this function duplicated in import controller?
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.
There's common code but one function uses isPVCImportPopulation
and AnnImportPod
and the other the upload equivalent. I can try to have one shared function but I think this practice is somewhat common in our controllers.
455dee9
to
ad7a682
Compare
_, ok := pvc.Annotations[cc.AnnPopulatorProgress] | ||
// Initialize the progress once PVC Prime is bound | ||
if !ok && cc.IsBound(pvcPrime) { | ||
cc.AddAnnotation(pvc, cc.AnnPopulatorProgress, "N/A") |
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.
This is a nasty patch to force a reconcile in the DV controller when the PVC' gets bound disguised as an annotation to initialize progress. It should fix the error in the tests, and it matches the behavior in the DV controller. After spending hours on this I think this is the best-looking solution.
bba8e23
to
1af88b0
Compare
With the addition of populators into CDI, we introduced a minor divergence in the DV status reporting between the new and the old flow to avoid checking PVC Prime. Though it would be ideal to completely ignore the PVC Prime in the DV layer, this divergence might confuse some users. This commit updates the status reporting mechanism so both the old flow and the populator flow match. Signed-off-by: Alvaro Romero <alromero@redhat.com>
1af88b0
to
adb502e
Compare
/retest-required |
/test pull-containerized-data-importer-e2e-nfs |
1 similar comment
/test pull-containerized-data-importer-e2e-nfs |
/lgtm Thanks @alromeros |
[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 |
/cherrypick release-v1.57 |
@alromeros: #2928 failed to apply on top of branch "release-v1.57":
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.58 |
@akalenyu: new pull request created: #2953 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. |
What this PR does / why we need it:
With the addition of populators into CDI, we introduced a minor divergence in the DataVolume status reporting between the new and the old flow to avoid checking PVC Prime from the legacy controllers.
Though it would be ideal to ignore the PVC Prime in the DV layer completely, there are certain cases where the reported status does not match the current behavior (check https://bugzilla.redhat.com/show_bug.cgi?id=2241637 for an example).
This PR aims to update the status reporting mechanism in import and upload controllers so both the old flow and the populator flow match.
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 # https://bugzilla.redhat.com/show_bug.cgi?id=2241637
Special notes for your reviewer:
It would be ideal to completely ignore the PVC Prime from the DV layer, but I think this solution will help us with all the specific cases where we are reporting a status that doesn't match CDI behavior. Let me know what you think.
Release note: