garden
garden copied to clipboard
Garden does not set replicas to 1 when in sync mode if patching resources
Bug
Current Behavior
When using the container
Deploy action, Garden will set the number of replicas to 1 when in sync mode, otherwise sync doesn't work.
This doesn't appear to be the case when using a kubernetes
Deploy action with patchResources
. Haven't tested without patchResources
but I suspect that's the culprit which basically overwrites the overwrite.
Expected behavior
Garden should set the number of replicas to 1 when in sync mode.
Reproducible example
- Use this example: https://github.com/garden-io/garden/tree/main/examples/k8s-deploy-patch-resources
- Set the value here to 2: https://github.com/garden-io/garden/blob/fd7aa9f7124ec6eeb7fb32b4d53b2885e1cd0f54/examples/k8s-deploy-patch-resources/web/garden.yml#L42
- Deploy in sync mode and observe that two pods get created
Workaround
Set the correct number of replicas in the patch. E.g.: replicas: ${this.mode == 'sync' ? 1 : 2}