Skip to content

Commit

Permalink
All other env vars are to be stringified
Browse files Browse the repository at this point in the history
[#97563344]
  • Loading branch information
Michael Fraenkel committed Jun 30, 2015
1 parent 0e0de33 commit 4ffa01a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/cloud_controller/diego/environment.rb
Expand Up @@ -22,6 +22,8 @@ def as_json(_={})
case v
when Array, Hash
v = MultiJson.dump(v)
else
v = v.to_s
end

env << { 'name' => k, 'value' => v }
Expand Down
4 changes: 4 additions & 0 deletions spec/unit/lib/cloud_controller/diego/environment_spec.rb
Expand Up @@ -8,6 +8,8 @@ module VCAP::CloudController::Diego
APP_KEY1: 'APP_VAL1',
APP_KEY2: { nested: 'data' },
APP_KEY3: [1, 2, 3],
APP_KEY4: 1,
APP_KEY5: true,
}
app
end
Expand All @@ -27,6 +29,8 @@ module VCAP::CloudController::Diego
{ 'name' => 'APP_KEY1', 'value' => 'APP_VAL1' },
{ 'name' => 'APP_KEY2', 'value' => '{"nested":"data"}' },
{ 'name' => 'APP_KEY3', 'value' => '[1,2,3]' },
{ 'name' => 'APP_KEY4', 'value' => '1' },
{ 'name' => 'APP_KEY5', 'value' => 'true' },
])
end

Expand Down

0 comments on commit 4ffa01a

Please sign in to comment.