diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2017-06-05 16:39:45 +0200 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2017-06-12 12:58:35 +0200 |
commit | b7d6bb9763ce0c682fae787c452103102624da26 (patch) | |
tree | e84543bbac2a2bd339b9b38b56e1746086d94455 /lib/ci | |
parent | c70e9f2ed107ac3d0189a803eae6e7e7917f6224 (diff) | |
download | gitlab-ce-b7d6bb9763ce0c682fae787c452103102624da26.tar.gz |
Ensure that old API v1 generates still the same output
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/api/entities.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/ci/api/entities.rb b/lib/ci/api/entities.rb index 792ff628b09..6733d1a33aa 100644 --- a/lib/ci/api/entities.rb +++ b/lib/ci/api/entities.rb @@ -45,7 +45,25 @@ module Ci expose :artifacts_expire_at, if: ->(build, _) { build.artifacts? } expose :options do |model| - model.options + options = model.options + + # This part ensures that output of old API is still the same after adding support + # for extended docker configuration options, used by new API + # + # I'm leaving this here, not in the model, because it should be removed at the same time + # when old API will be removed (planned for August 2017). + options[:image] = options[:image][:name] if options[:image].present? && options[:image].is_a?(Hash) + if options[:services].present? + options[:services].map! do |service| + if service.is_a?(Hash) + service[:name] + else + service + end + end + end + + options end expose :timeout do |model| |