forked from pool/cockpit-machines
37 lines
2.2 KiB
Diff
37 lines
2.2 KiB
Diff
From 6c982496f7b9cd9ef08308e1edd820b3910a7833 Mon Sep 17 00:00:00 2001
|
|
From: Miika Alikirri <miika.alikirri@suse.com>
|
|
Date: Wed, 25 Jun 2025 14:07:00 +0300
|
|
Subject: [PATCH] nics: ignore domain not found error caused by domain being
|
|
removed
|
|
|
|
If user is in the VMDetails page during migration, the VM might get
|
|
deleted before domainInterfaceAddresses is done processing. This race
|
|
condition can end up causing a confusing view where the UI shows a
|
|
redundant "Domain not found" error, and the regular "VM doesn't exist"
|
|
page at the same time
|
|
---
|
|
src/components/vm/nics/vmNicsCard.tsx | 9 ++++++++-
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/components/vm/nics/vmNicsCard.jsx b/src/components/vm/nics/vmNicsCard.jsx
|
|
index 8b309ac0..79efe152 100644
|
|
--- a/src/components/vm/nics/vmNicsCard.jsx
|
|
+++ b/src/components/vm/nics/vmNicsCard.jsx
|
|
@@ -239,8 +239,15 @@ export class VmNetworkTab extends React.Component {
|
|
domainInterfaceAddresses({ connectionName: this.props.vm.connectionName, objPath: this.props.vm.id })
|
|
.then(domifaddressAllSources => {
|
|
const allRejected = !domifaddressAllSources.some(promise => promise.status == 'fulfilled');
|
|
+ // If user is in the VMDetails page during migration, the VM might get deleted
|
|
+ // before domainInterfaceAddresses is done processing. This race condition can end up
|
|
+ // causing a confusing view where the UI shows a redundant "Domain not found error"
|
|
+ // and the regular VM doesn't exist page, at the same time.
|
|
+ const domainNotFound = domifaddressAllSources.some(promise =>
|
|
+ promise.status === 'rejected' && promise.reason?.message.startsWith("Domain not found:")
|
|
+ );
|
|
|
|
- if (allRejected)
|
|
+ if (allRejected && !domainNotFound)
|
|
this.props.onAddErrorNotification({
|
|
text: cockpit.format(_("Failed to fetch the IP addresses of the interfaces present in $0"), this.props.vm.name),
|
|
detail: [...new Set(domifaddressAllSources.map(promise => promise.reason ? promise.reason.message : ''))].join(', '),
|