all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lucas Barros <lucasbarros.kam@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Lucas Barros <lucasbarros.kam@gmail.com>
Subject: [PATCH manager v2 5/5] fix #7173: ui: guest: delete tags when removing the last tag
Date: Sun, 15 Nov 2026 22:00:40 -0300	[thread overview]
Message-ID: <20261116010040.90964-6-lucasbarros.kam@gmail.com> (raw)
In-Reply-To: <20261116010040.90964-1-lucasbarros.kam@gmail.com>

Removing the last tag of a guest in the tag editor of the guest panel
sends an empty 'tags' value, which is stored as an empty 'tags:' line in
the guest config.

Delete the option instead when no tag is left, which is what the
removal of the last tag means and also works with backends that do not
turn an empty tag list into a deletion themselves.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
---
changes since v1:
* new patch

Works on its own against nodes without patches 1/5 and 3/5, as
deleting 'tags' was always possible.

This patch was prepared with the help of an LLM based coding assistant;
I reviewed the change and ran the tests mentioned in the cover letter
myself.

 www/manager6/lxc/Config.js  | 4 +---
 www/manager6/qemu/Config.js | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 3a99d6a7..536ea557 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -208,9 +208,7 @@ Ext.define('PVE.lxc.Config', {
                     Proxmox.Utils.API2Request({
                         url: base_url + '/config',
                         method: 'PUT',
-                        params: {
-                            tags,
-                        },
+                        params: tags ? { tags } : { delete: 'tags' },
                         success: function () {
                             me.statusStore.load();
                         },
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index 842d35de..85a5e78e 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -255,9 +255,7 @@ Ext.define('PVE.qemu.Config', {
                     Proxmox.Utils.API2Request({
                         url: base_url + '/config',
                         method: 'PUT',
-                        params: {
-                            tags,
-                        },
+                        params: tags ? { tags } : { delete: 'tags' },
                         success: function () {
                             me.statusStore.load();
                         },
-- 
2.50.1 (Apple Git-155)




      parent reply	other threads:[~2026-11-16  1:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 13:56 [PATCH qemu-server] fix #7173: config: do not write out an empty tag list Lucas Barros
2026-11-11  9:53 ` Fabian Grünbichler
2026-11-16  1:00   ` [PATCH qemu-server/container/manager v2 0/5] fix #7173: do not keep an empty tag list in guest configs Lucas Barros
2026-11-16  1:00     ` [PATCH qemu-server v2 1/5] fix #7173: api: update: delete tags when an empty tag list is set Lucas Barros
2026-11-16  1:00     ` [PATCH qemu-server v2 2/5] config: ignore an empty tag list when parsing Lucas Barros
2026-11-16  1:00     ` [PATCH container v2 3/5] fix #7173: api: update: delete tags when an empty tag list is set Lucas Barros
2026-11-16  1:00     ` [PATCH container v2 4/5] config: ignore an empty tag list when parsing Lucas Barros
2026-11-16  1:00     ` Lucas Barros [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116010040.90964-6-lucasbarros.kam@gmail.com \
    --to=lucasbarros.kam@gmail.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal