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

Commit 078281a

Browse files
author
Aakash Shah
authored
Merge pull request cloudfoundry#1600 from akhinos/kpack-env
[WIP] Add environment variables to kpack image CR [#172301179]
2 parents b5a5e89 + b427112 commit 078281a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

lib/cloud_controller/kpack/stager.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ def image_resource(staging_details)
7575
blob: {
7676
url: blobstore_url_generator.package_download_url(staging_details.package),
7777
}
78+
},
79+
build: {
80+
env: staging_details.environment_variables.to_a.
81+
delete_if { |key, value| key == 'VCAP_SERVICES' }.
82+
map { |key, value| { name: key, value: value.to_s } }
7883
}
7984
}
8085
})

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

Lines changed: 4 additions & 1 deletion
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) { { 'nightshade_vegetable' => 'potato' } }
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
@@ -77,6 +77,9 @@ module Kpack
7777
blob: {
7878
url: 'package-download-url',
7979
}
80+
},
81+
build: {
82+
env: [{ name: 'BP_JAVA_VERSION', value: '8.*' }, { name: 'BPL_HEAD_ROOM', value: '0' }]
8083
}
8184
}
8285
}))

0 commit comments

Comments
 (0)