From 683b419047fdb263dac8f0bcb3b6248eb153609d Mon Sep 17 00:00:00 2001 From: maximilien Date: Mon, 7 Sep 2026 08:19:13 +0200 Subject: [PATCH] helm: add single-node unit tests --- script/helm/garage/tests/configmap_test.yaml | 9 +++++++ script/helm/garage/tests/workload_test.yaml | 27 ++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/script/helm/garage/tests/configmap_test.yaml b/script/helm/garage/tests/configmap_test.yaml index 82dae580..e7d2e941 100644 --- a/script/helm/garage/tests/configmap_test.yaml +++ b/script/helm/garage/tests/configmap_test.yaml @@ -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 diff --git a/script/helm/garage/tests/workload_test.yaml b/script/helm/garage/tests/workload_test.yaml index 19b6075f..7620a879 100644 --- a/script/helm/garage/tests/workload_test.yaml +++ b/script/helm/garage/tests/workload_test.yaml @@ -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: