Skip to content

Commit 47cc2d3

Browse files
pbuskoc0d1ngm0nk3y
andauthored
Fix application rename with CNB lifecycle (#4206)
* Fix application rename with CNB lifecycle * Simplified new code --------- Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
1 parent 0fcb815 commit 47cc2d3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/cloud_controller/diego/lifecycles/app_cnb_lifecycle.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def create_lifecycle_data_model(app)
1616
end
1717

1818
def valid?
19-
!buildpacks.empty?
19+
message.is_a?(AppUpdateMessage) || !buildpacks.empty?
2020
end
2121

2222
def errors

spec/unit/lib/cloud_controller/diego/lifecycles/app_cnb_lifecycle_spec.rb

+8
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ module VCAP::CloudController
102102
it 'invalid' do
103103
expect(lifecycle.valid?).to be(false)
104104
end
105+
106+
context 'during an update' do
107+
let(:message) { VCAP::CloudController::AppUpdateMessage.new(request) }
108+
109+
it 'valid' do
110+
expect(lifecycle.valid?).to be(true)
111+
end
112+
end
105113
end
106114

107115
context 'with buildpacks' do

0 commit comments

Comments
 (0)