Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-04-12 08:42:48 +0300
committerStan Hu <stanhu@gmail.com>2019-04-30 08:55:11 +0300
commit44eec56834b7f524a2bf99d0f5e1571b52576d72 (patch)
treecb7b15114b011992fbfb6c428b712d5c679c9fee /app/models/clusters/concerns
parent3c8df0c944f0b23f9ee8b6b08a0a355b00456dd9 (diff)
Expose can_uninstall in cluster_status.json
Only prometheus can be uninstalled atm, the rest will be dealt with later. Presumption is that new application types will have uninstallation implmemented at the same time.
Diffstat (limited to 'app/models/clusters/concerns')
-rw-r--r--app/models/clusters/concerns/application_core.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/clusters/concerns/application_core.rb b/app/models/clusters/concerns/application_core.rb
index ee964fb7c93..4514498b84b 100644
--- a/app/models/clusters/concerns/application_core.rb
+++ b/app/models/clusters/concerns/application_core.rb
@@ -18,6 +18,16 @@ module Clusters
self.status = 'installable' if cluster&.application_helm_available?
end
+ def can_uninstall?
+ allowed_to_uninstall?
+ end
+
+ # All new applications should uninstall by default
+ # Override if there's dependencies that needs to be uninstalled first
+ def allowed_to_uninstall?
+ true
+ end
+
def self.application_name
self.to_s.demodulize.underscore
end