diff options
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 |