Skip to content
Merged
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
5 changes: 3 additions & 2 deletions ocp_resources/virtual_machine_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def virt_launcher_pod(self):
label_selector=f"kubevirt.io=virt-launcher,kubevirt.io/created-by={self.instance.metadata.uid}",
)
)
if not pods:
raise ResourceNotFoundError(f"VIRT launcher POD not found for {self.kind}:{self.name}")

migration_state = self.instance.status.migrationState
if migration_state:
# After VM migration there are two pods, one in Completed status and one in Running status.
Expand All @@ -85,8 +88,6 @@ def virt_launcher_pod(self):
else:
return pods[0]

raise ResourceNotFoundError(f"VIRT launcher POD not found for {self.kind}:{self.name}")

@property
def virt_handler_pod(self):
pods = list(
Expand Down