diff options
-rw-r--r-- | app/models/project_services/kubernetes_service.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/variables/collection.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/variables/collection_spec.rb | 6 |
3 files changed, 5 insertions, 7 deletions
diff --git a/app/models/project_services/kubernetes_service.rb b/app/models/project_services/kubernetes_service.rb index c1c68be5ed9..edf80bbd509 100644 --- a/app/models/project_services/kubernetes_service.rb +++ b/app/models/project_services/kubernetes_service.rb @@ -115,7 +115,7 @@ class KubernetesService < DeploymentService collection.append(key: 'KUBE_CA_PEM_FILE', value: ca_pem, public: true, file: true) end - variables.to_hash + variables.to_runner_variables end # Constructs a list of terminals from the reactive cache diff --git a/lib/gitlab/ci/variables/collection.rb b/lib/gitlab/ci/variables/collection.rb index 0d830293c3c..e9aa7f9a31c 100644 --- a/lib/gitlab/ci/variables/collection.rb +++ b/lib/gitlab/ci/variables/collection.rb @@ -27,7 +27,7 @@ module Gitlab end end - def to_h + def to_runner_variables self.map do |variable| variable.to_h.reject do |key, value| key == :file && value == false @@ -35,8 +35,6 @@ module Gitlab end end - alias_method :to_hash, :to_h - private def fabricate(resource) diff --git a/spec/lib/gitlab/ci/variables/collection_spec.rb b/spec/lib/gitlab/ci/variables/collection_spec.rb index 39ed1cb4c26..16c23ae450a 100644 --- a/spec/lib/gitlab/ci/variables/collection_spec.rb +++ b/spec/lib/gitlab/ci/variables/collection_spec.rb @@ -52,11 +52,11 @@ describe Gitlab::Ci::Variables::Collection do end end - describe '#to_hash' do - it 'creates a hash / value mapping' do + describe '#to_runner_variables' do + it 'creates an array of hashes in a runner-compatible format' do collection = described_class.new([{ key: 'TEST', value: 1 }]) - expect(collection.to_hash) + expect(collection.to_runner_variables) .to eq [{ key: 'TEST', value: 1, public: false }] end end |