From 68accba902c003ced673b9c94b7a00e41f35bce4 Mon Sep 17 00:00:00 2001 From: neogopher Date: Fri, 10 May 2024 15:56:34 +0530 Subject: [PATCH] fix: use correct parameter name for etcd volumeclaim storage class --- chart/templates/etcd-statefulset.yaml | 4 ++-- chart/tests/etcd-statefulset_test.yaml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/chart/templates/etcd-statefulset.yaml b/chart/templates/etcd-statefulset.yaml index 7893258df..c014cd82b 100644 --- a/chart/templates/etcd-statefulset.yaml +++ b/chart/templates/etcd-statefulset.yaml @@ -43,8 +43,8 @@ spec: name: data spec: accessModes: {{ $externalEtcd.persistence.volumeClaim.accessModes }} - {{- if $externalEtcd.persistence.volumeClaim.className }} - storageClassName: {{ $externalEtcd.persistence.volumeClaim.className }} + {{- if $externalEtcd.persistence.volumeClaim.storageClass }} + storageClassName: {{ $externalEtcd.persistence.volumeClaim.storageClass }} {{- end }} resources: requests: diff --git a/chart/tests/etcd-statefulset_test.yaml b/chart/tests/etcd-statefulset_test.yaml index 73d57935f..520168098 100644 --- a/chart/tests/etcd-statefulset_test.yaml +++ b/chart/tests/etcd-statefulset_test.yaml @@ -58,6 +58,24 @@ tests: path: spec.template.spec.containers[0].image value: fabi.com/etcd:123 + - it: check specified storage class is used + set: + controlPlane: + backingStore: + etcd: + deploy: + enabled: true + statefulSet: + persistence: + volumeClaim: + storageClass: test-sc + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.volumeClaimTemplates[0].spec.storageClassName + value: test-sc + - it: enabled for k3s & non persistent set: controlPlane: