-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix: change the condition to consider a DV import failed #262
Conversation
/lgtm |
@@ -56,7 +56,7 @@ func HasDataVolumeFailedToImport(dataVolume *cdiv1beta1.DataVolume) bool { | |||
conditions := getConditionMapDv(dataVolume) | |||
return dataVolume.Status.Phase == cdiv1beta1.ImportInProgress && | |||
dataVolume.Status.RestartCount > constants.UnusualRestartCountThreshold && | |||
conditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionTrue && | |||
conditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionFalse && |
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.
Can the check be dropped instead? Do the other conditions suffice to assert the import failed?
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, probably the rest of the asserts are enough to check if the DV has failed. WDYT @ksimon1?
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.
fine by me
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.
Done!
The test `TaskRun fails and DataVolume is modified but does not import successfully` checks if a DV has failed by asserting several fields on the DV. One of them is `conditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionTrue`. In the current version of CDI, if a DV fails to fetch the import link, which is the scenario in this test, the underlining PVC is not bound. Therefore, the test assertion fails even if the DV has failed to import. Since the test already has a sufficient amount of assertions to check if a DV import failed, it drops the check `conditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionTrue`. Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
/lgtm |
/retest-required |
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.
/approve
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 0xFelix, jcanocan 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 |
/cherry-pick release-v0.15 |
@ksimon1: new pull request created: #266 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. |
@ksimon1: new pull request created: #267 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:
The test
TaskRun fails and DataVolume is modified but does not import successfully
checks if a DV has failed by asserting several fields on the DV. One of them isconditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionTrue
. In the current version of CDI, if a DV fails to fetch the import link, which is the scenario in this test, the underlining PVC is not bound. Therefore, the test assertion fails even if the DV has failed to import.It changes the logic of the function
HasDataVolumeFailedToImport
to check if a DV import has failed. Drops assertconditions[cdiv1beta1.DataVolumeBound].Status == v1.ConditionTrue
.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: