Skip to content

Disabled deployments remain disabled when replicas are updated to >= 1 #683

Description

@Phillezi

Describe the bug
When re-enabling disabled deployments (deployments with 0 replicas) by setting replicas back to >= 1 they remain disabled.

To Reproduce
Create a deployment with zero replicas ( or create one with x replicas and then update it to 0).

curl -X POST https://api.cloud.cbh.kth.se/deploy/v2/deployments \
-d'{
  "name": "randombugtestname",
  "cpuCores": 0.1,
  "ram": 0.1,
  "replicas": 0,
  "envs": null,
  "volumes": null,
  "initCommands": null,
  "args": null,
  "visibility": "private",
  "neverStale": false,
  "private": false,
  "image": "phillezi/litelogger:latest",
  "healthCheckPath": null,
  "zone": null
}' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <keycloak-jwt>" # or use X-Api header with a api token

(can be done on the swagger ui or through cloud.cbh.kth.se instead of curl too.)

Then re-enable it:

curl -X POST https://api.cloud.cbh.kth.se/deploy/v2/deployments/<deployment-id> \
-d'{
  "replicas": 1
}' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <keycloak-jwt>" # or use X-Api header with a api token

(can be done on the swagger ui or through cloud.cbh.kth.se instead of curl too.)

It remains disabled, despite having 1 replica. It gets updated if i update another spec like the cores or ram.

Expected behavior
The deployment should be re-enabled when replicas are updated to > 0.

Workaround fix
If you update cores or ram after changing the replicas back to > 0 it should re-enable it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions