diff options
Diffstat (limited to 'app/models/clusters/applications/ingress.rb')
-rw-r--r-- | app/models/clusters/applications/ingress.rb | 23 |
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 |