diff --git a/app/actions/deployment_create.rb b/app/actions/deployment_create.rb index 059217db11..8673a4442b 100644 --- a/app/actions/deployment_create.rb +++ b/app/actions/deployment_create.rb @@ -175,8 +175,8 @@ def deployment_for_stopped_app(app, message, previous_deployment, previous_dropl original_web_process_instance_count: desired_instances(app.oldest_web_process, previous_deployment), revision_guid: revision&.guid, revision_version: revision&.version, - strategy: DeploymentModel::ROLLING_STRATEGY, - max_in_flight: message.options ? message.options[:max_in_flight] : 1 + strategy: message.strategy, + max_in_flight: message.max_in_flight ) MetadataUpdate.update(deployment, message) diff --git a/spec/unit/actions/deployment_create_spec.rb b/spec/unit/actions/deployment_create_spec.rb index 8e5703d323..ab242555aa 100644 --- a/spec/unit/actions/deployment_create_spec.rb +++ b/spec/unit/actions/deployment_create_spec.rb @@ -493,6 +493,9 @@ module VCAP::CloudController end context 'when the app is stopped' do + let(:max_in_flight) { 3 } + let(:strategy) { 'canary' } + before do app.update(desired_state: ProcessModel::STOPPED) app.save @@ -525,6 +528,8 @@ module VCAP::CloudController expect(deployment.previous_droplet).to eq(original_droplet) expect(deployment.original_web_process_instance_count).to eq(3) expect(deployment.last_healthy_at).to eq(deployment.created_at) + expect(deployment.strategy).to eq('canary') + expect(deployment.max_in_flight).to eq(3) end it 'records an audit event for the deployment' do @@ -548,7 +553,7 @@ module VCAP::CloudController 'type' => nil, 'revision_guid' => app.latest_revision.guid, 'request' => message.audit_hash, - 'strategy' => 'rolling' + 'strategy' => 'canary' }) end