summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil TrzciƄski (Conference till 20th) <ayufan@ayufan.eu>2018-06-20 12:10:14 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-06-25 12:52:54 +0100
commitae04ccbca46260f206e8a910f9c533bd16583d0e (patch)
tree319f9b6cbd63f875fe0c70fc8660e584f2b19f8d /lib
parentdd41c8c944848cd47c0e6cfff08d50c7d90971b5 (diff)
downloadgitlab-ce-ae04ccbca46260f206e8a910f9c533bd16583d0e.tar.gz
Merge branch '48126-fix-prometheus-installation' into 'master'
Resolve "Unable to install Prometheus on Clusters: 'Error: Chart incompatible with Tiller v2.7.0'" Closes #48126 See merge request gitlab-org/gitlab-ce!20010
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/kubernetes/helm/install_command.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/gitlab/kubernetes/helm/install_command.rb b/lib/gitlab/kubernetes/helm/install_command.rb
index 30af3e97b4a..d2133a6d65b 100644
--- a/lib/gitlab/kubernetes/helm/install_command.rb
+++ b/lib/gitlab/kubernetes/helm/install_command.rb
@@ -2,11 +2,12 @@ module Gitlab
module Kubernetes
module Helm
class InstallCommand < BaseCommand
- attr_reader :name, :chart, :repository, :values
+ attr_reader :name, :chart, :version, :repository, :values
- def initialize(name, chart:, values:, repository: nil)
+ def initialize(name, chart:, values:, version: nil, repository: nil)
@name = name
@chart = chart
+ @version = version
@values = values
@repository = repository
end
@@ -39,9 +40,13 @@ module Gitlab
def script_command
<<~HEREDOC
- helm install #{chart} --name #{name} --namespace #{Gitlab::Kubernetes::Helm::NAMESPACE} -f /data/helm/#{name}/config/values.yaml >/dev/null
+ helm install #{chart} --name #{name}#{optional_version_flag} --namespace #{Gitlab::Kubernetes::Helm::NAMESPACE} -f /data/helm/#{name}/config/values.yaml >/dev/null
HEREDOC
end
+
+ def optional_version_flag
+ " --version #{version}" if version
+ end
end
end
end