Skip to content

Recreate Deployment Strategy #4396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

PeteLevineA
Copy link
Member

@PeteLevineA PeteLevineA commented Jun 5, 2025

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

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@PeteLevineA
Copy link
Member Author

Only unit tests created so far, will start implementing the feature to fix the tests.

@PeteLevineA PeteLevineA changed the title chore(TNZ-44895): start with recreate tests Recreate Deployment Strategy Jun 5, 2025
@PeteLevineA PeteLevineA marked this pull request as ready for review June 13, 2025 14:44
@PeteLevineA
Copy link
Member Author

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}]}

@Samze Samze marked this pull request as draft June 16, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant