@@ -136,7 +136,7 @@ Validate auth configuration
136136*/ }}
137137{{- define " valkey.validateAuthConfig" -}}
138138{{- if .Values.auth.enabled }}
139- {{- if not (or .Values.auth.aclUsers .Values.auth.aclConfig ) }}
139+ {{- if not (or .Values.auth.aclUsers .Values.auth.aclConfig .Values.auth.injectSecret.enabled ) }}
140140 {{- fail " auth.enabled is true but no authentication method is configured. Please provide auth.aclUsers or auth.aclConfig" }}
141141 {{- end }}
142142 {{- if .Values.auth.aclUsers }}
@@ -156,6 +156,17 @@ Validate auth configuration
156156 {{- end }}
157157 {{- end }}
158158 {{- end }}
159+ {{- if .Values.auth.injectSecret.enabled }}
160+ {{- if not .Values.auth.injectSecret.permissions }}
161+ {{- fail " auth.injectSecret.enabled is true but no permissions is configured." }}
162+ {{- end }}
163+ {{- if not .Values.auth.injectSecret.username }}
164+ {{- fail " auth.injectSecret.enabled is true but no username is configured." }}
165+ {{- end }}
166+ {{- if not .Values.auth.injectSecret.mountPath }}
167+ {{- fail " auth.injectSecret.enabled is true but no mountPath is configured." }}
168+ {{- end }}
169+ {{- end }}
159170{{- end }}
160171{{- end -}}
161172
@@ -181,7 +192,7 @@ Validate replica persistence configuration
181192Validate replica authentication configuration
182193*/ }}
183194{{- define " valkey.validateReplicaAuth" -}}
184- {{- if and .Values.replica.enabled .Values.auth.enabled }}
195+ {{- if and .Values.replica.enabled .Values.auth.enabled ( not .Values.auth.injectSecret.enabled ) }}
185196 {{- if not (hasKey .Values.auth.aclUsers .Values.replica.replicationUser ) }}
186197 {{- fail (printf " Replication user '%s ' (replica.replicationUser) must be defined in auth.aclUsers. The chart requires this to retrieve the password for replica authentication." .Values.replica.replicationUser ) }}
187198 {{- end }}
0 commit comments