diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-07-02 13:00:00 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-07-02 13:00:00 +0000 |
commit | a7cc29c89f71c8f80806115a70c92750d4350a92 (patch) | |
tree | 14d568eee2e7b9be3524bb05efcfdbd2daa17f89 /app | |
parent | 34a22b831135faeb8f4c70a3b8a3b8d525ccd164 (diff) | |
parent | 637e510da147f73587faa0414c67638c2e4729f7 (diff) | |
download | gitlab-ce-a7cc29c89f71c8f80806115a70c92750d4350a92.tar.gz |
Merge branch 'feature/uninstall_cluster_ingress' into 'master'
Feature/uninstall cluster ingress
See merge request gitlab-org/gitlab-ce!29977
Diffstat (limited to 'app')
-rw-r--r-- | app/models/clusters/applications/ingress.rb | 15 | ||||
-rw-r--r-- | app/models/clusters/applications/jupyter.rb | 4 | ||||
-rw-r--r-- | app/models/clusters/applications/prometheus.rb | 8 |
3 files changed, 12 insertions, 15 deletions
diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb index a1023f44049..1430b82c2f2 100644 --- a/app/models/clusters/applications/ingress.rb +++ b/app/models/clusters/applications/ingress.rb @@ -35,11 +35,8 @@ module Clusters 'stable/nginx-ingress' end - # We will implement this in future MRs. - # Basically we need to check all dependent applications are not installed - # first. def allowed_to_uninstall? - false + external_ip_or_hostname? && application_jupyter_nil_or_installable? end def install_command @@ -52,6 +49,10 @@ module Clusters ) end + def external_ip_or_hostname? + external_ip.present? || external_hostname.present? + end + def schedule_status_update return unless installed? return if external_ip @@ -63,6 +64,12 @@ module Clusters def ingress_service cluster.kubeclient.get_service('ingress-nginx-ingress-controller', Gitlab::Kubernetes::Helm::NAMESPACE) end + + private + + def application_jupyter_nil_or_installable? + cluster.application_jupyter.nil? || cluster.application_jupyter&.installable? + end end end end diff --git a/app/models/clusters/applications/jupyter.rb b/app/models/clusters/applications/jupyter.rb index 9e4b87d0993..9ede0615fa3 100644 --- a/app/models/clusters/applications/jupyter.rb +++ b/app/models/clusters/applications/jupyter.rb @@ -23,9 +23,7 @@ module Clusters return unless cluster&.application_ingress_available? ingress = cluster.application_ingress - if ingress.external_ip || ingress.external_hostname - self.status = 'installable' - end + self.status = 'installable' if ingress.external_ip_or_hostname? end def chart diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index a6b7617b830..805c8a73f8c 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -49,14 +49,6 @@ module Clusters ) end - def uninstall_command - Gitlab::Kubernetes::Helm::DeleteCommand.new( - name: name, - rbac: cluster.platform_kubernetes_rbac?, - files: files - ) - end - def upgrade_command(values) ::Gitlab::Kubernetes::Helm::InstallCommand.new( name: name, |