forked from kubevirt/kubevirt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
instancetype: Apply instancetype to copy of VM during admission
Previously the VirtualMachine validation webhook would attempt to apply any referenced instancetype and preferences to the provided VirtualMachineInstanceSpec within the VirtualMachine before validating the contents. Doing so however would cause calls to validateSnapshotStatus to fail when a snapshot was in progress as the now updated VirtualMachineInstanceSpec differed from the original. In issue kubevirt#8435 this left the Snapshot controller unable to update the VirtualMachine with a required finalizer, blocking the progress of the overall snapshot. This change corrects this by applying any referenced instancetype and preferences to a copy of the VirtualMachine and using this updated copy to validate the fully rendered VirtualMachineInstanceSpec. Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
- Loading branch information
Showing
3 changed files
with
34 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters