diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-07-25 16:36:58 +0100 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-07-30 13:08:32 +0000 |
commit | dc8ccbb6e0b9e14ff90e34661beee01da33008c7 (patch) | |
tree | b9cc4a58ebfe4ed6eefbb079b194ed809f774465 /app/models/clusters/concerns | |
parent | 628ff2cf173f9dd9cac437991084b4507830154c (diff) | |
download | gitlab-ce-dc8ccbb6e0b9e14ff90e34661beee01da33008c7.tar.gz |
Minor refactoring of Helm and ApplicationData
Diffstat (limited to 'app/models/clusters/concerns')
-rw-r--r-- | app/models/clusters/concerns/application_data.rb | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/app/models/clusters/concerns/application_data.rb b/app/models/clusters/concerns/application_data.rb index 7738138e753..d66f09d48b5 100644 --- a/app/models/clusters/concerns/application_data.rb +++ b/app/models/clusters/concerns/application_data.rb @@ -15,15 +15,8 @@ module Clusters def files @files ||= begin files = { 'values.yaml': values } - if cluster.application_helm.has_ssl? - ca_cert = cluster.application_helm.ca_cert - helm_cert = cluster.application_helm.issue_cert - files.merge!({ - 'ca.pem': ca_cert, - 'cert.pem': helm_cert.cert_string, - 'key.pem': helm_cert.key_string - }) - end + + files.merge!(certificate_files) if cluster.application_helm.has_ssl? files end @@ -31,6 +24,22 @@ module Clusters private + def certificate_files + { + 'ca.pem': ca_cert, + 'cert.pem': helm_cert.cert_string, + 'key.pem': helm_cert.key_string + } + end + + def ca_cert + cluster.application_helm.ca_cert + end + + def helm_cert + @helm_cert ||= cluster.application_helm.issue_client_cert + end + def chart_values_file "#{Rails.root}/vendor/#{name}/values.yaml" end |