Fix the helm install failed 43/12943/2
authorZhang Rong(Jon) <rong.zhang@windriver.com>
Fri, 7 Jun 2024 03:29:01 +0000 (11:29 +0800)
committerZhang Rong(Jon) <rong.zhang@windriver.com>
Wed, 12 Jun 2024 15:34:26 +0000 (23:34 +0800)
The Helm install will fail if the persistent volume is not enabled.

This commit addresses this issue. If the persistent database
is disabled, Helm will install successfully.

Test Plan:
1. Set the persistent database to true, and verify that the persistent
   volume works correctly.
2. Set the persistent database to false, and verify that Helm installs
   correctly.

Issue-ID: INF-465
Change-Id: I2f3f483ccac5386b8746e259d601fab8385073f7
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
charts/templates/persistent_volume.yaml

index c39d70a..4f20cd7 100644 (file)
@@ -13,6 +13,7 @@
 #  limitations under the License.
 
 ---
+{{- if .Values.db.persistence }}
 apiVersion: v1
 kind: PersistentVolumeClaim
 metadata:
@@ -25,4 +26,5 @@ spec:
     requests:
       storage: {{ .Values.db.storageSize }}
   storageClassName: general
+{{- end }}
 ---
\ No newline at end of file