gitlab-org--gitlab-foss/app/models/clusters/applications/helm.rb

32 lines
706 B
Ruby
Raw Normal View History

module Clusters
2017-11-02 14:10:46 +00:00
module Applications
class Helm < ActiveRecord::Base
self.table_name = 'clusters_applications_helm'
2017-11-02 16:57:50 +00:00
include ::Clusters::Concerns::ApplicationStatus
2017-11-02 14:31:25 +00:00
belongs_to :cluster, class_name: 'Clusters::Cluster', foreign_key: :cluster_id
2017-11-02 15:57:18 +00:00
default_value_for :version, Gitlab::Kubernetes::Helm::HELM_VERSION
validates :cluster, presence: true
2017-11-03 18:20:29 +00:00
def self.application_name
self.to_s.demodulize.underscore
end
2017-11-07 12:50:04 +00:00
def initial_status
if cluster&.platform_kubernetes_active?
:installable
else
:not_installable
end
end
def name
2017-11-03 18:20:29 +00:00
self.class.application_name
end
end
end
end