GitLab steht Mittwoch, den 23. September, zwischen 10:00 und 12:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit be386cb2 authored by Thong Kuah's avatar Thong Kuah

Expose app version to frontend

parent e4dc22e3
...@@ -4,6 +4,7 @@ class ClusterApplicationEntity < Grape::Entity ...@@ -4,6 +4,7 @@ class ClusterApplicationEntity < Grape::Entity
expose :name expose :name
expose :status_name, as: :status expose :status_name, as: :status
expose :status_reason expose :status_reason
expose :version
expose :external_ip, if: -> (e, _) { e.respond_to?(:external_ip) } expose :external_ip, if: -> (e, _) { e.respond_to?(:external_ip) }
expose :hostname, if: -> (e, _) { e.respond_to?(:hostname) } expose :hostname, if: -> (e, _) { e.respond_to?(:hostname) }
expose :email, if: -> (e, _) { e.respond_to?(:email) } expose :email, if: -> (e, _) { e.respond_to?(:email) }
......
---
title: Expose version for each application in cluster_status JSON endpoint
merge_request: 24791
author:
type: other
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
] ]
} }
}, },
"version": { "type": "string" },
"status_reason": { "type": ["string", "null"] }, "status_reason": { "type": ["string", "null"] },
"external_ip": { "type": ["string", "null"] }, "external_ip": { "type": ["string", "null"] },
"hostname": { "type": ["string", "null"] }, "hostname": { "type": ["string", "null"] },
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe ClusterApplicationEntity do describe ClusterApplicationEntity do
describe '#as_json' do describe '#as_json' do
let(:application) { build(:clusters_applications_helm) } let(:application) { build(:clusters_applications_helm, version: '0.1.1') }
subject { described_class.new(application).as_json } subject { described_class.new(application).as_json }
it 'has name' do it 'has name' do
...@@ -13,6 +13,10 @@ describe ClusterApplicationEntity do ...@@ -13,6 +13,10 @@ describe ClusterApplicationEntity do
expect(subject[:status]).to eq(:not_installable) expect(subject[:status]).to eq(:not_installable)
end end
it 'has version' do
expect(subject[:version]).to eq('0.1.1')
end
it 'has no status_reason' do it 'has no status_reason' do
expect(subject[:status_reason]).to be_nil expect(subject[:status_reason]).to be_nil
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment