[pve-devel] [PATCH manager] ContentView: block removal of in-use container image

Fabian Ebner f.ebner at proxmox.com
Thu Aug 27 13:16:55 CEST 2020


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 at 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






More information about the pve-devel mailing list