public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ContentView: block removal of in-use container image
Date: Thu, 27 Aug 2020 13:16:55 +0200	[thread overview]
Message-ID: <20200827111655.22957-1-f.ebner@proxmox.com> (raw)

Since commit 5dae1a319b32ea3ebbb0b48a9f0b5e3abd1833c9 in pve-storage,
list_volumes correctly returns content type 'rootdir' for container images.
Adapt the relevant check here to make removal behave like it does
for VM images again.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 www/manager6/storage/ContentView.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index c70c732c..194ad42e 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -432,7 +432,8 @@ Ext.define('PVE.storage.ContentView', {
 	    selModel: sm,
 	    delay: 5,
 	    enableFn: function(rec) {
-		if (rec && rec.data.content !== 'images') {
+		if (rec && rec.data.content !== 'images' &&
+			   rec.data.content !== 'rootdir') {
 		    imageRemoveButton.setVisible(false);
 		    removeButton.setVisible(true);
 		    return true;
@@ -450,7 +451,8 @@ Ext.define('PVE.storage.ContentView', {
 	    hidden: true,
 	    text: gettext('Remove'),
 	    enableFn: function(rec) {
-		if (rec && rec.data.content === 'images') {
+		if (rec && (rec.data.content === 'images' ||
+			    rec.data.content === 'rootdir')) {
 		    removeButton.setVisible(false);
 		    imageRemoveButton.setVisible(true);
 		    return true;
-- 
2.20.1





             reply	other threads:[~2020-08-27 11:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 11:16 Fabian Ebner [this message]
2020-08-28  8:25 ` [pve-devel] applied: " Thomas Lamprecht
2020-08-28 12:51   ` [pve-devel] sdn patches ready for review Alexandre DERUMIER
2020-08-28 13:09     ` Thomas Lamprecht
2020-08-28 14:17       ` Alexandre DERUMIER
2020-10-05 15:20     ` Alexandre Aderumier

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=20200827111655.22957-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal