Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-01-18 12:43:27 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-01-18 12:43:27 +0300
commit35c3cb7c480e812d3c6dcd8f8e2eb6c6a2da83b1 (patch)
treeb5ada2cc3a5bee068e12e044fb668fb9ca421f02 /app/models/clusters/applications
parent2f3a00405ca7ded9c193d6119517c8a2f9550f34 (diff)
parentd87486e678cd2d957e504109c3665ab84de1a6cc (diff)
Merge branch '55544-port-upgrade-command' into 'master'
Port generic Helm upgrade functionality to CE See merge request gitlab-org/gitlab-ce!23924
Diffstat (limited to 'app/models/clusters/applications')
-rw-r--r--app/models/clusters/applications/prometheus.rb27
1 files changed, 21 insertions, 6 deletions
diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb
index e25be522d68..26bf73f4dd8 100644
--- a/app/models/clusters/applications/prometheus.rb
+++ b/app/models/clusters/applications/prometheus.rb
@@ -5,7 +5,8 @@ module Clusters
class Prometheus < ActiveRecord::Base
include PrometheusAdapter
- VERSION = '6.7.3'.freeze
+ VERSION = '6.7.3'
+ READY_STATUS = [:installed, :updating, :updated, :update_errored].freeze
self.table_name = 'clusters_applications_prometheus'
@@ -24,12 +25,8 @@ module Clusters
end
end
- def ready_status
- [:installed]
- end
-
def ready?
- ready_status.include?(status_name)
+ READY_STATUS.include?(status_name)
end
def chart
@@ -55,6 +52,24 @@ module Clusters
)
end
+ def upgrade_command(values)
+ ::Gitlab::Kubernetes::Helm::UpgradeCommand.new(
+ name,
+ version: VERSION,
+ chart: chart,
+ rbac: cluster.platform_kubernetes_rbac?,
+ files: files_with_replaced_values(values)
+ )
+ end
+
+ # Returns a copy of files where the values of 'values.yaml'
+ # are replaced by the argument.
+ #
+ # See #values for the data format required
+ def files_with_replaced_values(replaced_values)
+ files.merge('values.yaml': replaced_values)
+ end
+
def prometheus_client
return unless kube_client