Skip to content
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

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

jcanocan
Copy link
Contributor

@jcanocan jcanocan commented Sep 20, 2023

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 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.

It changes the logic of the function HasDataVolumeFailedToImport to check if a DV import has failed. Drops assert conditions[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:

NONE

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XS labels Sep 20, 2023
@ksimon1
Copy link
Member

ksimon1 commented Sep 21, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2023
@@ -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 &&
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine by me

Copy link
Contributor Author

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>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2023
@ksimon1
Copy link
Member

ksimon1 commented Sep 22, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2023
@jcanocan
Copy link
Contributor Author

/retest-required

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Thanks!

@openshift-ci
Copy link

openshift-ci bot commented Sep 25, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 25, 2023
@ksimon1 ksimon1 merged commit eaac552 into kubevirt:main Sep 25, 2023
6 checks passed
@ksimon1
Copy link
Member

ksimon1 commented Oct 2, 2023

/cherry-pick release-v0.15

@openshift-cherrypick-robot

@ksimon1: new pull request created: #266

In response to this:

/cherry-pick release-v0.15

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.

@kubevirt-bot
Copy link

@ksimon1: new pull request created: #267

In response to this:

/cherry-pick release-v0.15

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants