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

[release-0.58] instancetype, snapshot: Capture and restore instancetype ControllerRevisions #8810

Merged

Conversation

lyarwood
Copy link
Member

What this PR does / why we need it:

/area instancetype
/cc @0xFelix
/cc @davidvossel
/cc @iholder-redhat

This is a manual cherry-pick of #8466

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:

  • ddd9454 has been pulled in to keep d67fc1f as clean as possible.
  • d67fc1f has a single conflict caused by the lack of 09b5824 on the v0.58.0 branch.

Release note:

NONE

iholder101 and others added 6 commits November 17, 2022 14:24
Signed-off-by: Itamar Holder <iholder@redhat.com>
This change introduces the cloning of any referenced instancetype
ControllerRevisions from the source VirtualMachine during a snapshot.
The resulting cloned ControllerRevisions are then referenced from the
VirtualMachine stored within the created VirtualMachineSnapshotContent
resource.

A following change will introduce support on the restore side to again
clone these ControllerRevisions for use by the resulting VirtualMachine.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
Building on previous changes that essentially cloned any referenced
instancetype or preference ControllerRevisions during the creation of a
VirtualMachineSnapshot we can now restore these into the existing or new
VirtualMachine.

When restoring for use by a new VirtualMachine we need to ensure that
the newly created ControllerRevisions are claimed by the new
VirtualMachine once it has been created.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
Conflicts:
  tests/clone_test.go

NOTE(lyarwood): generateCloneFromVM is replaced with generateClone as
09b5824 isn't present on the v0.58.0
branch.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
GenerateKubeVirtGroupVersionKind ensures a provided object registered
with KubeVirts generated schema has GVK set correctly. This is required
as client-go continues to return objects without TypeMeta set as set out
in the following closed but often cited issue:

Object's TypeMeta is empty
kubernetes/client-go#413

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

0xFelix commented Nov 17, 2022

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2022
@0xFelix
Copy link
Member

0xFelix commented Nov 17, 2022

/retest

Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidvossel

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 Nov 18, 2022
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

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/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants