diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 22:11:55 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 22:11:55 +0000 |
commit | 5a8431feceba47fd8e1804d9aa1b1730606b71d5 (patch) | |
tree | e5df8e0ceee60f4af8093f5c4c2f934b8abced05 /app/serializers/projects/serverless/service_entity.rb | |
parent | 4d477238500c347c6553d335d920bedfc5a46869 (diff) | |
download | gitlab-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.rb | 38 |
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 |