2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Kubernetes
|
|
|
|
module Helm
|
|
|
|
module ClientCommand
|
|
|
|
def init_command
|
2020-10-24 23:57:45 +05:30
|
|
|
<<~SHELL.chomp
|
2020-01-01 13:55:28 +05:30
|
|
|
export HELM_HOST="localhost:44134"
|
|
|
|
tiller -listen ${HELM_HOST} -alsologtostderr &
|
|
|
|
helm init --client-only
|
2020-10-24 23:57:45 +05:30
|
|
|
SHELL
|
2019-02-15 15:39:39 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def repository_command
|
|
|
|
['helm', 'repo', 'add', name, repository].shelljoin if repository
|
|
|
|
end
|
2019-09-30 21:07:59 +05:30
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
def repository_update_command
|
|
|
|
'helm repo update'
|
|
|
|
end
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
def optional_tls_flags
|
|
|
|
return [] unless files.key?(:'ca.pem')
|
|
|
|
|
|
|
|
[
|
|
|
|
'--tls',
|
|
|
|
'--tls-ca-cert', "#{files_dir}/ca.pem",
|
|
|
|
'--tls-cert', "#{files_dir}/cert.pem",
|
|
|
|
'--tls-key', "#{files_dir}/key.pem"
|
|
|
|
]
|
|
|
|
end
|
2019-02-15 15:39:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|