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

instancetype: Ignore unexpected existing CRs during restore #8891

Merged
merged 2 commits into from
Dec 6, 2022

Conversation

lyarwood
Copy link
Member

@lyarwood lyarwood commented Dec 1, 2022

/area instancetype

What this PR does / why we need it:

5cc62c0 failed to accommodate repeat
attempts to reconcile a VirtualMachineRestore that in turn lead to
multiple calls to restoreInstancetypeControllerRevision being made for
the same ControllerRevision.

This change handles this case by ignoring any existing
ControllerRevisions found during the restore, assuming that the existing
ControllerRevision was created by a previous call to
restoreInstancetypeControllerRevision.

Future changes will check the contents of this ControllerRevision
against that of the VirtualMachineSnapshot to ensure they 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 #8890

Special notes for your reviewer:

Release note:

NONE

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
5cc62c0 failed to accommodate repeat
attempts to reconcile a VirtualMachineRestore that in turn lead to
multiple calls to restoreInstancetypeControllerRevision being made for
the same ControllerRevision.

This change handles this case by ignoring any existing
ControllerRevisions found during the restore, assuming that the existing
ControllerRevision was created by a previous call to
restoreInstancetypeControllerRevision.

Future changes will check the contents of this ControllerRevision
against that of the VirtualMachineSnapshot to ensure they match.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. area/instancetype dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Dec 1, 2022
@lyarwood
Copy link
Member Author

lyarwood commented Dec 1, 2022

/cherrypick release-0.58
/cc @0xFelix
/cc @iholder101
/cc @davidvossel

This is fallout from #8466 and was uncovered downstream when an unrelated issue in a test environment caused the creation of a VirtualMachine during a restore to fail, that re-enqueued the restore triggering this valid issue with my original change. #8890 hopefully covers this well but please let me know if something isn't clear.

@kubevirt-bot
Copy link
Contributor

@lyarwood: once the present PR merges, I will cherry-pick it on top of release-0.58 in a new PR and assign it to you.

In response to this:

/cherrypick release-0.58
/cc @0xFelix
/cc @iholder101
/cc @davidvossel

This is fallout from #8466 and was uncovered downstream when an unrelated issue in a test environment caused the creation of a VirtualMachine during a restore to fail, that re-enqueued the restore triggering this valid issue with my original change. #8890 hopefully covers this well but please let me know if something isn't clear.

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.

@lyarwood
Copy link
Member Author

lyarwood commented Dec 1, 2022

/retest

1 similar comment
@lyarwood
Copy link
Member Author

lyarwood commented Dec 2, 2022

/retest

Copy link
Contributor

@iholder101 iholder101 left a comment

Choose a reason for hiding this comment

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

Thanks @lyarwood, looks good to me and totally makes sense.
Left a tiny nit

Comment on lines +1192 to +1193
originalVM.Spec.Instancetype = getVMInstancetypeMatcher()
originalVM.Spec.Preference = getVMPreferenceMatcher()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why do we need these functions? can't we simply pass the matcher directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah we can, this is something I need to go back and clean up in a follow up, at the time I originally wrote these tests I was having a hard time understanding how to pass things into tables. This worked and made it past the review for the original PR so I've stuck with it here so this change can be backported.

@mhenriks
Copy link
Member

mhenriks commented Dec 6, 2022

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2022
@kubevirt-bot
Copy link
Contributor

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2022
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.

/lgtm
/retest

@kubevirt-bot
Copy link
Contributor

@lyarwood: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-e2e-k8s-1.25-sig-network da47c2c link true /test pull-kubevirt-e2e-k8s-1.25-sig-network

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. I understand the commands that are listed here.

@lyarwood
Copy link
Member Author

lyarwood commented Dec 6, 2022

/retest

@kubevirt-bot
Copy link
Contributor

@lyarwood: new pull request created: #8912

In response to this:

/cherrypick release-0.58
/cc @0xFelix
/cc @iholder101
/cc @davidvossel

This is fallout from #8466 and was uncovered downstream when an unrelated issue in a test environment caused the creation of a VirtualMachine during a restore to fail, that re-enqueued the restore triggering this valid issue with my original change. #8890 hopefully covers this well but please let me know if something isn't clear.

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. area/instancetype dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L
Projects
None yet
5 participants