Skip to content

Commit 28cad85

Browse files
committed
Added chart validation checks for new configuration options
1 parent 7b91789 commit 28cad85

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Chart validation checks:
2+
3+
{{- define "checkConditionReplicaCount" -}}
4+
{{- if and (gt (int .Values.deploymentSettings.replicaCount) 1) .Values.matlabProductionServerSettings.autoDeploy.archivesApi.createPVC }}
5+
{{- if ne .Values.matlabProductionServerSettings.autoDeploy.archivesApi.accessMode "ReadWriteMany" }}
6+
{{- fail "Configuring multiple replicas requires PVC with ReadWriteMany Access-Mode." }}
7+
{{- end }}
8+
{{- end }}
9+
{{- end }}
10+
11+
{{- define "checkConditionVolumeType" -}}
12+
{{- if .Values.matlabProductionServerSettings.autoDeploy.archivesApi.enabled }}
13+
{{- $volumeType := .Values.matlabProductionServerSettings.autoDeploy.volumeType }}
14+
{{- if and (ne $volumeType "pvc") (ne $volumeType "empty") }}
15+
{{- fail "Configuring archives API is only supported with pvc or empty volume types." }}
16+
{{- end }}
17+
{{- end }}
18+
{{- end }}

releases/R2025a/matlab-prodserver/templates/mps-3-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#
22
# MATLAB Production Server instance
33
#
4+
{{- include "checkConditionVolumeType" . }}
5+
{{- include "checkConditionReplicaCount" . }}
6+
47
apiVersion: apps/v1
58
kind: Deployment
69
metadata:

0 commit comments

Comments
 (0)