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

Commit 209323a

Browse files
create droplet on kpack Image update
[#172542372] Co-authored-by: Connor Braa <cbraa@pivotal.io> Co-authored-by: Piyali Banerjee <pbanerjee@pivotal.io>
1 parent b8eb81f commit 209323a

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/cloud_controller/kpack/stager.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def mark_build_as_failed(build, message)
5151
end
5252

5353
def update_image_resource(image, staging_details, builder_spec)
54+
image.metadata.labels[DROPLET_GUID_LABEL_KEY.to_sym] = create_droplet_and_get_guid(staging_details)
5455
image.metadata.labels[BUILD_GUID_LABEL_KEY.to_sym] = staging_details.staging_guid
5556
image.spec.source.blob.url = blobstore_url_generator.package_download_url(staging_details.package)
5657
image.spec.build.env = get_environment_variables(staging_details)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ module Kpack
255255
labels: {
256256
Stager::APP_GUID_LABEL_KEY => package.app.guid,
257257
Stager::BUILD_GUID_LABEL_KEY => 'old-build-guid',
258+
Stager::DROPLET_GUID_LABEL_KEY => 'old-droplet-guid',
258259
Stager::STAGING_SOURCE_LABEL_KEY => 'STG',
259260
},
260261
annotations: {
@@ -291,6 +292,7 @@ module Kpack
291292
it 'updates the existing Image resource' do
292293
updated_image = Kubeclient::Resource.new(existing_image.to_hash)
293294
updated_image.metadata.labels[Kpack::Stager::BUILD_GUID_LABEL_KEY.to_sym] = build.guid
295+
updated_image.metadata.labels[Kpack::Stager::DROPLET_GUID_LABEL_KEY.to_sym] = droplet.guid
294296
updated_image.spec.source.blob.url = 'package-download-url'
295297
updated_image.spec.build.env = [
296298
{ name: 'FOO', value: 'BAR' }

0 commit comments

Comments
 (0)