Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 45a9d11

Browse files
committed
Display app env variables from app object, not process / revision
* So that apps can show env var changes even if not yet restarted [finishes #171751119] Authored-by: Renee Chu <rchu@pivotal.io>
1 parent f91ec74 commit 45a9d11

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

app/controllers/runtime/app_summaries_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def summary(guid)
2525
'available_domains' => (process.space.organization.private_domains + SharedDomain.all).map(&:as_summary_json)
2626
}.merge(process.to_hash)
2727

28+
app_info['environment_json'] = process.app.environment_variables
29+
2830
MultiJson.dump(app_info)
2931
end
3032

spec/unit/controllers/runtime/app_summaries_controller_spec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ module VCAP::CloudController
99
@shared_domain = SharedDomain.make
1010
@shared_domain.save
1111

12-
@space = Space.make
13-
@route1 = Route.make(space: @space)
14-
@route2 = Route.make(space: @space)
12+
@space = Space.make
13+
@environment_json = { 'HELLO' => 'WORLD' }
14+
@route1 = Route.make(space: @space)
15+
@route2 = Route.make(space: @space)
1516
@services = []
1617

1718
@process = ProcessModelFactory.make(
@@ -20,6 +21,7 @@ module VCAP::CloudController
2021
instances: 1,
2122
memory: @free_mem_size,
2223
state: 'STARTED',
24+
environment_json: @environment_json
2325
)
2426

2527
@num_services.times do
@@ -56,6 +58,8 @@ module VCAP::CloudController
5658
it 'should contain the basic app attributes' do
5759
expect(last_response.status).to eq(200)
5860
expect(decoded_response['guid']).to eq(@process.app.guid)
61+
expect(decoded_response['environment_json']).to eq({ 'HELLO' => 'WORLD' })
62+
5963
parse(MultiJson.dump(@process.to_hash)).each do |k, v|
6064
expect(v).to eql(decoded_response[k.to_s]), "value of field #{k} expected to eql #{v}"
6165
end

0 commit comments

Comments
 (0)