File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
lib/cloud_controller/diego/cnb
spec/unit/lib/cloud_controller/diego/cnb Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def stage_action
4545 path : '/tmp/lifecycle/builder' ,
4646 user : 'vcap' ,
4747 args : args ,
48- env : env_vars
48+ env : env_vars + platform_options_env
4949 )
5050 end
5151 end
Original file line number Diff line number Diff line change @@ -173,6 +173,34 @@ module CNB
173173 let ( :expected_credhub_arg ) do
174174 { 'VCAP_PLATFORM_OPTIONS' => { 'credhub-uri' => credhub_url } }
175175 end
176+
177+ context 'when credhub url is present' do
178+ context 'when the interpolation of service bindings is enabled' do
179+ before do
180+ TestConfig . override ( credential_references : { interpolate_service_bindings : true } )
181+ end
182+
183+ it 'sends the credhub_url in the environment variables' do
184+ result = builder . action
185+ actions = result . serial_action . actions
186+
187+ expect ( actions [ 1 ] . run_action . env ) . to eq ( bbs_env + expected_platform_options )
188+ end
189+ end
190+
191+ context 'when the interpolation of service bindings is disabled' do
192+ before do
193+ TestConfig . override ( credential_references : { interpolate_service_bindings : false } )
194+ end
195+
196+ it 'does not send the credhub_url in the environment variables' do
197+ result = builder . action
198+ actions = result . serial_action . actions
199+
200+ expect ( actions [ 1 ] . run_action . env ) . to eq ( bbs_env )
201+ end
202+ end
203+ end
176204 end
177205
178206 context 'when there is no buildpack cache' do
You can’t perform that action at this time.
0 commit comments