From 6720c31aa9299ea8289144756dcb3895c7c2a392 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Tue, 11 Aug 2020 12:38:41 +1200 Subject: [PATCH] fix(k8s/volume): only show resize modal for used volumes (#4194) --- .../views/volumes/edit/volumeController.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/kubernetes/views/volumes/edit/volumeController.js b/app/kubernetes/views/volumes/edit/volumeController.js index 6f20455c9..304657298 100644 --- a/app/kubernetes/views/volumes/edit/volumeController.js +++ b/app/kubernetes/views/volumes/edit/volumeController.js @@ -104,12 +104,16 @@ class KubernetesVolumeController { } updateVolume() { - this.ModalService.confirmRedeploy( - 'One or multiple applications are currently using this volume.
For the change to be taken into account these applications will need to be redeployed. Do you want us to reschedule it now?', - (redeploy) => { - return this.$async(this.updateVolumeAsync, redeploy); - } - ); + if (KubernetesVolumeHelper.isUsed(this.volume)) { + this.ModalService.confirmRedeploy( + 'One or multiple applications are currently using this volume.
For the change to be taken into account these applications will need to be redeployed. Do you want us to reschedule it now?', + (redeploy) => { + return this.$async(this.updateVolumeAsync, redeploy); + } + ); + } else { + return this.$async(this.updateVolumeAsync, false); + } } async getVolumeAsync() {