Deployment actors will set the goal according to the required action based on the given user input.
- When scaling down, the instances that are selected to be killed will be set to goal Decommissioned if they are not resident, and to goal Stopped if they contain a reservation.
- When deleting a runSpec, all instances will be set to goal Decommissioned even if they are resident.
- When using the wipe=true flag when killing instances, the goal is always set to Decommissioned.
- When upgrading a service, old instances will be set to goal Decommissioned once they are selected to be killed. Instances with reservations will be set to Stopped and then Running once the tasks have been killed. (we need to start new instances with new instance ids)
- When killing instances via the API without scale=true or wipe=true, the goal state is set to Decommissioned and a new instance is created once the old one has been expunged. See the note below wrt to future behavior.
Later on, when killing instances via the API without scale=true or wipe=true, the goal state is not changed but will stay in Running. Only the associated tasks shall be killed. This requires that the instance will be matched by the scheduler and a new task will be launched with an incremented attempt count.