提交 8f41c857 编写于 作者: D Dylan Griffith

Minor style improvements for Helm code

上级 0582df8e
...@@ -26,6 +26,10 @@ module Gitlab ...@@ -26,6 +26,10 @@ module Gitlab
Gitlab::Kubernetes::ConfigMap.new(name, files).generate Gitlab::Kubernetes::ConfigMap.new(name, files).generate
end end
def file_names
files.keys
end
def name def name
raise "Not implemented" raise "Not implemented"
end end
......
...@@ -33,9 +33,13 @@ module Gitlab ...@@ -33,9 +33,13 @@ module Gitlab
end end
def script_command def script_command
<<~HEREDOC "helm install" \
helm install#{optional_tls_flags} #{chart} --name #{name}#{optional_version_flag} --namespace #{Gitlab::Kubernetes::Helm::NAMESPACE} -f /data/helm/#{name}/config/values.yaml >/dev/null "#{optional_tls_flags} " \
HEREDOC "#{chart} " \
"--name #{name}" \
"#{optional_version_flag} " \
"--namespace #{Gitlab::Kubernetes::Helm::NAMESPACE} " \
"-f /data/helm/#{name}/config/values.yaml >/dev/null\n"
end end
def optional_version_flag def optional_version_flag
......
...@@ -59,7 +59,7 @@ module Gitlab ...@@ -59,7 +59,7 @@ module Gitlab
name: 'configuration-volume', name: 'configuration-volume',
configMap: { configMap: {
name: "values-content-configuration-#{command.name}", name: "values-content-configuration-#{command.name}",
items: command.files.map { |name, _| { key: name, path: name } } items: command.file_names.map { |name| { key: name, path: name } }
} }
} }
] ]
......
...@@ -35,12 +35,15 @@ FactoryBot.define do ...@@ -35,12 +35,15 @@ FactoryBot.define do
factory :clusters_applications_ingress, class: Clusters::Applications::Ingress do factory :clusters_applications_ingress, class: Clusters::Applications::Ingress do
cluster factory: %i(cluster with_installed_helm provided_by_gcp) cluster factory: %i(cluster with_installed_helm provided_by_gcp)
end end
factory :clusters_applications_prometheus, class: Clusters::Applications::Prometheus do factory :clusters_applications_prometheus, class: Clusters::Applications::Prometheus do
cluster factory: %i(cluster with_installed_helm provided_by_gcp) cluster factory: %i(cluster with_installed_helm provided_by_gcp)
end end
factory :clusters_applications_runner, class: Clusters::Applications::Runner do factory :clusters_applications_runner, class: Clusters::Applications::Runner do
cluster factory: %i(cluster with_installed_helm provided_by_gcp) cluster factory: %i(cluster with_installed_helm provided_by_gcp)
end end
factory :clusters_applications_jupyter, class: Clusters::Applications::Jupyter do factory :clusters_applications_jupyter, class: Clusters::Applications::Jupyter do
oauth_application factory: :oauth_application oauth_application factory: :oauth_application
cluster factory: %i(cluster with_installed_helm provided_by_gcp) cluster factory: %i(cluster with_installed_helm provided_by_gcp)
......
...@@ -121,6 +121,7 @@ describe 'Clusters Applications', :js do ...@@ -121,6 +121,7 @@ describe 'Clusters Applications', :js do
def wait_until_helm_created! def wait_until_helm_created!
retries = 0 retries = 0
while Clusters::Cluster.last.application_helm.nil? while Clusters::Cluster.last.application_helm.nil?
raise "Timed out waiting for helm application to be created in DB" if (retries += 1) > 3 raise "Timed out waiting for helm application to be created in DB" if (retries += 1) > 3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册