summaryrefslogtreecommitdiff
path: root/app/serializers/projects/serverless/service_entity.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
commit5a8431feceba47fd8e1804d9aa1b1730606b71d5 (patch)
treee5df8e0ceee60f4af8093f5c4c2f934b8abced05 /app/serializers/projects/serverless/service_entity.rb
parent4d477238500c347c6553d335d920bedfc5a46869 (diff)
downloadgitlab-ce-5a8431feceba47fd8e1804d9aa1b1730606b71d5.tar.gz
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
Diffstat (limited to 'app/serializers/projects/serverless/service_entity.rb')
-rw-r--r--app/serializers/projects/serverless/service_entity.rb38
1 files changed, 31 insertions, 7 deletions
diff --git a/app/serializers/projects/serverless/service_entity.rb b/app/serializers/projects/serverless/service_entity.rb
index a1e0bf02d11..10360e575bb 100644
--- a/app/serializers/projects/serverless/service_entity.rb
+++ b/app/serializers/projects/serverless/service_entity.rb
@@ -44,28 +44,52 @@ module Projects
end
expose :url do |service|
- service.dig('status', 'url') || "http://#{service.dig('status', 'domain')}"
+ knative_06_07_url(service) || knative_05_url(service)
end
expose :description do |service|
+ knative_07_description(service) || knative_05_06_description(service)
+ end
+
+ expose :image do |service|
service.dig(
'spec',
'runLatest',
'configuration',
- 'revisionTemplate',
+ 'build',
+ 'template',
+ 'name')
+ end
+
+ private
+
+ def knative_07_description(service)
+ service.dig(
+ 'spec',
+ 'template',
'metadata',
'annotations',
- 'Description')
+ 'Description'
+ )
end
- expose :image do |service|
+ def knative_05_url(service)
+ "http://#{service.dig('status', 'domain')}"
+ end
+
+ def knative_06_07_url(service)
+ service.dig('status', 'url')
+ end
+
+ def knative_05_06_description(service)
service.dig(
'spec',
'runLatest',
'configuration',
- 'build',
- 'template',
- 'name')
+ 'revisionTemplate',
+ 'metadata',
+ 'annotations',
+ 'Description')
end
end
end