summaryrefslogtreecommitdiff
path: root/app/serializers/cluster_entity.rb
blob: 84ce34afb32f217a244bd2ec9efbe7ce162353e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class ClusterEntity < Grape::Entity
  include RequestAwareEntity

  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