summaryrefslogtreecommitdiff
path: root/app/models/clusters/applications/ingress.rb
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2017-12-22 17:23:43 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2017-12-22 17:23:43 +0000
commit0d4548026f3060ca0a8f7aa8d8fc89838bc66130 (patch)
treec6282c19a6f57b605ae7854a1de0779caaeb24fe /app/models/clusters/applications/ingress.rb
parent79cbfedf670bfc446b64bb74e36d1c93f3180235 (diff)
downloadgitlab-ce-0d4548026f3060ca0a8f7aa8d8fc89838bc66130.tar.gz
Extend Cluster Applications to allow installation of Prometheus
Diffstat (limited to 'app/models/clusters/applications/ingress.rb')
-rw-r--r--app/models/clusters/applications/ingress.rb23
1 files changed, 2 insertions, 21 deletions
diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb
index 44bd979741e..9024f1df1cd 100644
--- a/app/models/clusters/applications/ingress.rb
+++ b/app/models/clusters/applications/ingress.rb
@@ -3,41 +3,22 @@ module Clusters
class Ingress < ActiveRecord::Base
self.table_name = 'clusters_applications_ingress'
+ include ::Clusters::Concerns::ApplicationCore
include ::Clusters::Concerns::ApplicationStatus
- belongs_to :cluster, class_name: 'Clusters::Cluster', foreign_key: :cluster_id
-
- validates :cluster, presence: true
-
default_value_for :ingress_type, :nginx
default_value_for :version, :nginx
- after_initialize :set_initial_status
-
enum ingress_type: {
nginx: 1
}
- def self.application_name
- self.to_s.demodulize.underscore
- end
-
- def set_initial_status
- return unless not_installable?
-
- self.status = 'installable' if cluster&.application_helm_installed?
- end
-
- def name
- self.class.application_name
- end
-
def chart
'stable/nginx-ingress'
end
def install_command
- Gitlab::Kubernetes::Helm::InstallCommand.new(name, false, chart)
+ Gitlab::Kubernetes::Helm::InstallCommand.new(name, chart: chart)
end
end
end