Recreate Deployment Strategy
Elect to use the deployment strategy of recreate
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
-
A short explanation of the proposed change: App developers can set Recreate deployment strategy in the API
-
An explanation of the use cases your change solves With a default deployment strategy created users may like to elect to use the original deployment strategy of recreate
-
Links to any other associated PRs
-
[x] I have reviewed the contributing guide
-
[x] I have viewed, signed, and submitted the Contributor License Agreement
-
[x] I have made this pull request to the
mainbranch -
[x] I have run all the unit tests using
bundle exec rake -
[ ] I have run CF Acceptance Tests
Only unit tests created so far, will start implementing the feature to fix the tests.
Ran the following scenarios: Create a new deployment with type recreate: cf curl "/v3/deployments" -X POST -H "Content-Type: application/json" -d '{ "droplet": { "guid": "73c4ee39-5275-4f61-a935-f89d058fa64c"}, "strategy": "recreate", "relationships": { "app": { "data": { "guid": "a25fa181-7983-4c02-a287-58275952869f" } } } }' got: "value":"ACTIVE","reason":"DEPLOYING","details":{"last_successful_healthcheck":"2025-06-12T17:47:35Z","last_status_change":"2025-06-12T17:47:35Z"}},"strategy":"recreate"
cf curl "/v3/deployments?app_guids=a25fa181-7983-4c02-a287-58275952869f" got status":{"value":"FINALIZED","reason":"DEPLOYED","details":{"last_successful_healthcheck":"2025-06-12T17:47:50Z","last_status_change":"2025-06-12T17:48:05Z"}},"strategy":"recreate"
Rolled back to a previous droplet using recreate: cf curl "/v3/deployments" -X POST -H "Content-Type: application/json" -d '{ "droplet": { "guid": "7c0fab37-e72e-4d2f-aa92-a3e1152e11f3"}, "strategy": "recreate", "relationships": { "app": { "data": { "guid": "a25fa181-7983-4c02-a287-58275952869f" } } } }' got status":{"value":"ACTIVE","reason":"DEPLOYING","details":{"last_successful_healthcheck":"2025-06-12T17:52:56Z","last_status_change":"2025-06-12T17:52:56Z"}},"strategy":"recreate"
Tried recreate with max-in-flight cf curl "/v3/deployments" -X POST -H "Content-Type: application/json" -d '{ "droplet": { "guid": "7c0fab37-e72e-4d2f-aa92-a3e1152e11f3"}, "strategy": "recreate", "options": { "max_in_flight": 2 }, "relationships": { "app": { "data": { "guid": "a25fa181-7983-4c02-a287-58275952869f" } } } }' {"errors":[{"detail":"Options max in flight is not a supported option for recreate deployment strategy","title":"CF-UnprocessableEntity","code":10008}]}
Tried recreate with canary steps cf curl "/v3/deployments" -X POST -H "Content-Type: application/json" -d '{ "droplet": { "guid": "7c0fab37-e72e-4d2f-aa92-a3e1152e11f3"}, "strategy": "recreate", "options": { "canary": { "steps": [ { "instance_weight": 10 } ] } }, "relationships": { "app": { "data": { "guid": "a25fa181-7983-4c02-a287-58275952869f" } } } }' {"errors":[{"detail":"Options canary are only valid for Canary deployments","title":"CF-UnprocessableEntity","code":10008}]}
Closing as this is out of date, will reopen