-
Notifications
You must be signed in to change notification settings - Fork 364
Description
Issue
Once a rollback to a previous revision has been cancelled before the rollback has completed, all attempts to re-run that same rollback fail because the backend seems to think that the code and config to be rolled back to is the same as the currently deployed revision.
Context
The CLI Team is implementing the revisions and rollback CLI commands.
In the output of cf revisions APP_NAME
, a (deployed)
decorator is displayed adjacent to the revision number(s) that's currently deployed as per /v3/apps/:guid/revisions/deployed
.
Click HERE to view screenshot of the UX.
We found a specific sequence where the backend is preventing rollback to a previous revision because it is the same as the deployed revision
, but that is clearly not the case.
Once it's in this state, it isn't possible to rollback to the target revision.
Steps to Reproduce
Env/Setup:
cf api
API endpoint: https://api.arsicault.cli.fun
API version: 3.88.0
cf version
cf version 7.1.0+e3e7571bc.2020-09-26
Repro:
Using the latest edge version of the v7 CLI
- open two terminals and target the same env/org/space
- In term 1:
- cf push app_name 3X
- cf rollback app_name --revision 1 -f
- In term 2:
- before the term 1 rollback has completed
- cf cancel-deployment app_name
- In term 1:
- cf rollback app_name --revision 1 -f
Expected result
I'd expect the rollback to succeed without error since the previous rollback to revision 1 was cancelled and the currently deployed revision is revision 3 - which doesn't share the same droplet as revision 1.
A new revision cloudfoundry/capi-release#4 was created during the cancelled rollback, but the system still appears to think the currently deployed revision is revision cloudfoundry/capi-release#3
cf curl /v3/apps/$(cf app app_name --guid)/revisions/deployed
However, it's responding as if it believes the rollback was completed successfully and that I'm trying to rollback from revision #4 which does have the same code and configs as revision cloudfoundry/capi-release#1
Current result
the rollback fails with the following error:
cf rollback dora3 --revision 1 -f
This command is in EXPERIMENTAL stage and may change without notice
Rolling back to revision 1 for app dora3 in org o / space s as admin...
Creating deployment for app dora3...
Unable to rollback. The code and configuration you are rolling back to is the same as the deployed revision.
FAILED