diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-31 13:29:56 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-31 14:23:31 +0300 |
commit | 84f5aaa729d6286252602800a1f9e1bf1e5b47d3 (patch) | |
tree | c144d77c478862303ac12cded4415f597cb8779b /app/serializers | |
parent | 6d462cea77508e407995c58b0ae581edefa74d22 (diff) |
WIP: mock cluster apps status API
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/cluster_entity.rb | 12 | ||||
-rw-r--r-- | app/serializers/cluster_serializer.rb | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/app/serializers/cluster_entity.rb b/app/serializers/cluster_entity.rb index 08a113c4d8a..84ce34afb32 100644 --- a/app/serializers/cluster_entity.rb +++ b/app/serializers/cluster_entity.rb @@ -3,4 +3,16 @@ class ClusterEntity < Grape::Entity expose :status_name, as: :status expose :status_reason + expose :applications do |cluster, options| + if cluster.created? + { + helm: { status: 'installed' }, + ingress: { status: 'error', status_reason: 'Missing namespace' }, + runner: { status: 'installing' }, + prometheus: { status: 'installable' } + } + else + {} + end + end end diff --git a/app/serializers/cluster_serializer.rb b/app/serializers/cluster_serializer.rb index 2c87202a105..2e13c1501e7 100644 --- a/app/serializers/cluster_serializer.rb +++ b/app/serializers/cluster_serializer.rb @@ -2,6 +2,6 @@ class ClusterSerializer < BaseSerializer entity ClusterEntity def represent_status(resource) - represent(resource, { only: [:status, :status_reason] }) + represent(resource, { only: [:status, :status_reason, :applications] }) end end |