helm: add single-node unit tests

This commit is contained in:
maximilien
2026-09-07 08:19:13 +02:00
parent 4d83477bb6
commit 683b419047
2 changed files with 36 additions and 0 deletions
@@ -128,6 +128,15 @@ tests:
# namespace: NAMESPACE
replication_factor = 7
- it: forces replication_factor to 1 when garage.singleNode is enabled
set:
garage.singleNode: true
garage.replicationFactor: "5"
asserts:
- matchRegex:
path: data["garage.toml"]
pattern: 'replication_factor = 1'
- it: does not render a ConfigMap when an existing one is referenced
set:
garage.existingConfigMap: my-external-cm
@@ -167,6 +167,33 @@ tests:
path: spec.template.spec.volumes[0].configMap.name
value: my-external-cm
- it: runs a single replica with --single-node when garage.singleNode is enabled
template: templates/workload.yaml
set:
garage.singleNode: true
deployment.replicaCount: 3
asserts:
- equal:
path: spec.replicas
value: 1
- equal:
path: spec.template.spec.containers[0].command
value:
- /garage
- equal:
path: spec.template.spec.containers[0].args
value:
- server
- --single-node
- it: does not set a custom command/args when garage.singleNode is disabled
template: templates/workload.yaml
asserts:
- isNull:
path: spec.template.spec.containers[0].command
- isNull:
path: spec.template.spec.containers[0].args
- it: uses a custom service account name without creating one when disabled
template: templates/workload.yaml
set: