From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 7D70C1FF0B3 for ; Fri, 25 Sep 2026 11:44:10 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DEBF12187B; Fri, 25 Sep 2026 11:42:39 +0200 (CEST) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v3 16/16] ui: guest destroy: add control for dangling IPSet references Date: Fri, 25 Sep 2026 11:42:30 +0200 Message-ID: <20260925094230.844917-17-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260925094230.844917-1-a.bied-charreton@proxmox.com> References: <20260925094230.844917-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 2 AWL 0.535 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: VBPSZ3UYA3PRP6ZEO7ZEAME3VZ2ETRKX X-Message-ID-Hash: VBPSZ3UYA3PRP6ZEO7ZEAME3VZ2ETRKX X-MailFrom: abied-charreton@jett.proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Destroying a guest releases its IPAM entries, so the auto-generated 'guest-ipam-' IPSet disappears with it. Rules referencing that IPSet do not resolve anymore and are silently dropped from the generated ruleset. Add the shared selector to the destroy dialog, so those rules can be disabled or deleted along with the guest, next to a hint linking to the SDN firewall integration documentation. 'keep' remains the default, matching the API. The 'note' config only renders a single hint, so it is replaced by two display fields among the additional items. Signed-off-by: Arthur Bied-Charreton --- www/manager6/window/SafeDestroyGuest.js | 44 ++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/www/manager6/window/SafeDestroyGuest.js b/www/manager6/window/SafeDestroyGuest.js index 45b277e5..45099342 100644 --- a/www/manager6/window/SafeDestroyGuest.js +++ b/www/manager6/window/SafeDestroyGuest.js @@ -32,7 +32,46 @@ Ext.define('PVE.window.SafeDestroyGuest', { }, ], - note: gettext('Referenced disks will always be destroyed.'), + initComponent: function () { + let me = this; + + let helpLink = Ext.htmlEncode(Proxmox.Utils.get_help_link('pvesdn_firewall_integration')); + let helpLabel = Ext.htmlEncode(gettext('this guest\'s auto-generated IPSet')); + let refsHint = Ext.String.format( + gettext('Firewall rules referencing {0} will no longer resolve.'), + `${helpLabel}`, + ); + + me.additionalItems = [ + // build fresh array per instance, pushing would append every time the dialog is opened + ...me.additionalItems, + { + xtype: 'displayfield', + userCls: 'pmx-hint', + value: gettext('Referenced disks will always be destroyed.'), + }, + { + xtype: 'displayfield', + userCls: 'pmx-hint', + value: refsHint, + }, + { + xtype: 'pveFirewallDanglingReferences', + reference: 'firewallDanglingReferencesButton', + value: 'keep', + labelWidth: 200, + keepTip: gettext( + 'Keep referencing rules. They are dropped from the generated ruleset and shown as invalid until a guest with the same VMID is recreated.', + ), + disableTip: gettext( + 'Disable referencing rules, keeping them in the firewall configuration.', + ), + dropTip: gettext('Delete referencing rules.'), + }, + ]; + + me.callParent(); + }, getParams: function () { let me = this; @@ -43,6 +82,9 @@ Ext.define('PVE.window.SafeDestroyGuest', { let destroyUnreferencedCheckbox = me.lookupReference('destroyUnreferencedCheckbox'); me.params['destroy-unreferenced-disks'] = destroyUnreferencedCheckbox.checked ? 1 : 0; + let danglingRefs = me.lookupReference('firewallDanglingReferencesButton'); + me.params['dangling-ipset-references'] = danglingRefs.getValue(); + return me.callParent(); }, }); -- 2.47.3