summaryrefslogtreecommitdiff
path: root/app/models/clusters
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-03-17 05:52:35 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-03-17 05:52:35 +0000
commit83874edb77235d2a276f114f72942c43e8be3a44 (patch)
tree890ac40129ec2fadda1e2e3ad609cdc9a7605537 /app/models/clusters
parent53e2987ba6a8b2fb79f5754ae13924f2939d81fd (diff)
parentea5221aeb358ef6c349cfa09b9c6993bd7bd027d (diff)
downloadgitlab-ce-83874edb77235d2a276f114f72942c43e8be3a44.tar.gz
Merge branch 'master' into 'update-kubeclient'
Conflicts: Gemfile.lock
Diffstat (limited to 'app/models/clusters')
-rw-r--r--app/models/clusters/platforms/kubernetes.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb
index 738d1e2bc82..ba6552f238f 100644
--- a/app/models/clusters/platforms/kubernetes.rb
+++ b/app/models/clusters/platforms/kubernetes.rb
@@ -56,19 +56,19 @@ module Clusters
def predefined_variables
config = YAML.dump(kubeconfig)
- variables = [
- { key: 'KUBE_URL', value: api_url, public: true },
- { key: 'KUBE_TOKEN', value: token, public: false },
- { key: 'KUBE_NAMESPACE', value: actual_namespace, public: true },
- { key: 'KUBECONFIG', value: config, public: false, file: true }
- ]
-
- if ca_pem.present?
- variables << { key: 'KUBE_CA_PEM', value: ca_pem, public: true }
- variables << { key: 'KUBE_CA_PEM_FILE', value: ca_pem, public: true, file: true }
+ Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ variables
+ .append(key: 'KUBE_URL', value: api_url)
+ .append(key: 'KUBE_TOKEN', value: token, public: false)
+ .append(key: 'KUBE_NAMESPACE', value: actual_namespace)
+ .append(key: 'KUBECONFIG', value: config, public: false, file: true)
+
+ if ca_pem.present?
+ variables
+ .append(key: 'KUBE_CA_PEM', value: ca_pem)
+ .append(key: 'KUBE_CA_PEM_FILE', value: ca_pem, file: true)
+ end
end
-
- variables
end
# Constructs a list of terminals from the reactive cache