Skip to content

Commit 61ca706

Browse files
authored
Fix setting strategy and max in flight for stopped app deployments (#3910)
1 parent 6b76837 commit 61ca706

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/actions/deployment_create.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ def deployment_for_stopped_app(app, message, previous_deployment, previous_dropl
175175
original_web_process_instance_count: desired_instances(app.oldest_web_process, previous_deployment),
176176
revision_guid: revision&.guid,
177177
revision_version: revision&.version,
178-
strategy: DeploymentModel::ROLLING_STRATEGY,
179-
max_in_flight: message.options ? message.options[:max_in_flight] : 1
178+
strategy: message.strategy,
179+
max_in_flight: message.max_in_flight
180180
)
181181

182182
MetadataUpdate.update(deployment, message)

spec/unit/actions/deployment_create_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,9 @@ module VCAP::CloudController
493493
end
494494

495495
context 'when the app is stopped' do
496+
let(:max_in_flight) { 3 }
497+
let(:strategy) { 'canary' }
498+
496499
before do
497500
app.update(desired_state: ProcessModel::STOPPED)
498501
app.save
@@ -525,6 +528,8 @@ module VCAP::CloudController
525528
expect(deployment.previous_droplet).to eq(original_droplet)
526529
expect(deployment.original_web_process_instance_count).to eq(3)
527530
expect(deployment.last_healthy_at).to eq(deployment.created_at)
531+
expect(deployment.strategy).to eq('canary')
532+
expect(deployment.max_in_flight).to eq(3)
528533
end
529534

530535
it 'records an audit event for the deployment' do
@@ -548,7 +553,7 @@ module VCAP::CloudController
548553
'type' => nil,
549554
'revision_guid' => app.latest_revision.guid,
550555
'request' => message.audit_hash,
551-
'strategy' => 'rolling'
556+
'strategy' => 'canary'
552557
})
553558
end
554559

0 commit comments

Comments
 (0)