fix: reject negative process counts when scaling
A process count below zero was accepted and stored verbatim, leaving the scheduler to reject the value long after the command reported success. Counts below zero are now rejected, as are process tuples that omit a process type, across `ps:scale`, the `ps-set-scale` trigger and the `formation` key of `app.json`. A negative count persisted by an earlier version stays readable so it can be corrected with `ps:scale`.
This commit is contained in:
8 files changed
+292
-3
No files matched your search
@@ -158,7 +158,7 @@ On subsequent deploys:
|
||||
|
||||
- `autoscaling` (map of string to object, optional) autoscaling rules. See the autoscaling section for more details
|
||||
- `max_parallel`: (int, optional) number of instances to deploy in parallel at a given time
|
||||
- `quantity`: (int, optional) number of processes to maintain. Default 1 for web processes, 0 for all others.
|
||||
- `quantity`: (int, optional) number of processes to maintain. Must be zero or greater. Default 1 for web processes, 0 for all others.
|
||||
- `service`: (map of string to oject, optional) governs how non-web processes are exposed as services on the network
|
||||
|
||||
### Autoscaling
|
||||
|
||||
@@ -2396,7 +2396,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
### `ps-set-scale`
|
||||
|
||||
- Description: Sets the scale for an app based on a specified formation (process-type=quantity). Any unspecified process types will be left as is, or have their process count set to zero when `$CLEAR_EXISTING` is `true`.
|
||||
- Description: Sets the scale for an app based on a specified formation (process-type=quantity). Any unspecified process types will be left as is, or have their process count set to zero when `$CLEAR_EXISTING` is `true`. Each process tuple must name a process type, and process counts must be zero or greater.
|
||||
- Invoked by:
|
||||
- Arguments: `$APP $SKIP_DEPLOY $CLEAR_EXISTING [$PROCESS_TUPLE...]`
|
||||
- Example:
|
||||
|
||||
@@ -248,6 +248,9 @@ Multiple process types can be scaled at once:
|
||||
dokku ps:scale node-js-app web=1 worker=1
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Each argument must name a process type, and process counts must be zero or greater. Scaling a process type to `0` stops all of its containers, while a negative count is rejected.
|
||||
|
||||
If desired, the corresponding deploy will be skipped by using the `--skip-deploy` flag:
|
||||
|
||||
```shell
|
||||
|
||||
Reference in new issue
Block a user