diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-19 09:09:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-19 09:09:36 +0300 |
commit | a04f7f36d7a8fb7657de899879f904e23b93ce42 (patch) | |
tree | e9e1afe2ecdfb62a9677944f63ee4d49e01d9f64 /app/models/clusters | |
parent | dc97e5514114912508318ada1d35666d85fd3ab7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/clusters')
-rw-r--r-- | app/models/clusters/cluster.rb | 4 | ||||
-rw-r--r-- | app/models/clusters/integrations/prometheus.rb | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index feac7bbc363..73ee4aca43c 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -150,9 +150,7 @@ module Clusters scope :for_project_namespace, -> (namespace_id) { joins(:projects).where(projects: { namespace_id: namespace_id }) } scope :with_name, -> (name) { where(name: name) } - # with_application_prometheus scope is deprecated, and scheduled for removal - # in %14.0. See https://gitlab.com/groups/gitlab-org/-/epics/4280 - scope :with_application_prometheus, -> { includes(:application_prometheus).joins(:application_prometheus) } + scope :with_integration_prometheus, -> { includes(:integration_prometheus).joins(:integration_prometheus) } scope :with_project_http_integrations, -> (project_ids) do conditions = { projects: :alert_management_http_integrations } includes(conditions).joins(conditions).where(projects: { id: project_ids }) diff --git a/app/models/clusters/integrations/prometheus.rb b/app/models/clusters/integrations/prometheus.rb index d745a49afc1..8b21fa351a3 100644 --- a/app/models/clusters/integrations/prometheus.rb +++ b/app/models/clusters/integrations/prometheus.rb @@ -14,6 +14,13 @@ module Clusters validates :cluster, presence: true validates :enabled, inclusion: { in: [true, false] } + # Periodically checked and kept up to date for Monitor demo projects + enum health_status: { + unknown: 0, + healthy: 1, + unhealthy: 2 + } + attr_encrypted :alert_manager_token, mode: :per_attribute_iv, key: Settings.attr_encrypted_db_key_base_32, |