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

Commit b427112

Browse files
committed
Filter out VCAP_SERVICES from environment variables
1 parent 0b35016 commit b427112

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/cloud_controller/kpack/stager.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ def image_resource(staging_details)
7676
url: blobstore_url_generator.package_download_url(staging_details.package),
7777
}
7878
},
79-
build: {
79+
build: {
8080
env: staging_details.environment_variables.to_a.
81-
map{ | key , value | {name: key, value: value.to_s() } }
81+
delete_if { |key, value| key == 'VCAP_SERVICES' }.
82+
map { |key, value| { name: key, value: value.to_s } }
8283
}
8384
}
8485
})

spec/unit/lib/cloud_controller/kpack/stager_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Kpack
1111
)
1212
}
1313
let(:package) { VCAP::CloudController::PackageModel.make }
14-
let(:environment_variables) { { 'BP_JAVA_VERSION' => '8.*', 'BPL_HEAD_ROOM' => 0} }
14+
let(:environment_variables) { { 'BP_JAVA_VERSION' => '8.*', 'BPL_HEAD_ROOM' => 0, 'VCAP_SERVICES' => { postgres: [] } } }
1515
let(:staging_memory_in_mb) { 1024 }
1616
let(:staging_disk_in_mb) { 1024 }
1717
let(:blobstore_url_generator) do
@@ -79,7 +79,7 @@ module Kpack
7979
}
8080
},
8181
build: {
82-
env: [ {name: "BP_JAVA_VERSION", value: "8.*"} , {name: "BPL_HEAD_ROOM", value: "0"}]
82+
env: [{ name: 'BP_JAVA_VERSION', value: '8.*' }, { name: 'BPL_HEAD_ROOM', value: '0' }]
8383
}
8484
}
8585
}))

0 commit comments

Comments
 (0)