Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ocp_resources/virtual_machine_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
teardown=True,
yaml_file=None,
delete_timeout=TIMEOUT_4MINUTES,
volume_name_policy=None,
volume_restore_policy=None,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this introdcues a breaking change
how was this verified if this is a wrong name?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we can look in the git blame

Copy link
Copy Markdown
Contributor

@jpeimer jpeimer May 20, 2026

Choose a reason for hiding this comment

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

It was introduced only 2 weeks ago #2709
I believe @vsibirsk looked at the VMClone and thought it's the same field name for VMRestore, but it's different (and Vasiliy noticed this in the initial review for @acinko-rh's PR in the tests repo)

VirtualMachineRestore.spec.volumeRestorePolicy
VirtualMachineClone.spec.volumeNamePolicy

**kwargs,
):
super().__init__(
Expand All @@ -37,7 +37,7 @@ def __init__(
)
self.vm_name = vm_name
self.snapshot_name = snapshot_name
self.volume_name_policy = volume_name_policy
self.volume_restore_policy = volume_restore_policy

def to_dict(self) -> None:
super().to_dict()
Expand All @@ -47,8 +47,8 @@ def to_dict(self) -> None:
spec["target"]["kind"] = VirtualMachine.kind
spec["target"]["name"] = self.vm_name
spec["virtualMachineSnapshotName"] = self.snapshot_name
if self.volume_name_policy:
spec["volumeNamePolicy"] = self.volume_name_policy
if self.volume_restore_policy:
spec["volumeRestorePolicy"] = self.volume_restore_policy

def wait_complete(self, status=True, timeout=TIMEOUT_4MINUTES):
"""
Expand Down