@@ -97,8 +97,8 @@ Formula: (~totalMemoryMB / 10) capped between 25-200
9797Validate that pooler and direct are not both "auto"
9898*/ }}
9999{{- define " cnpg-cluster.validateConnections" -}}
100- {{- $pooler := .Values.connections.pooler -}}
101- {{- $direct := .Values.connections.direct -}}
100+ {{- $pooler := .Values.connections.pooler | toString -}}
101+ {{- $direct := .Values.connections.direct | toString -}}
102102{{- if and (eq $pooler " auto" ) (eq $direct " auto" ) -}}
103103 {{- fail " Error: connections.pooler and connections.direct cannot both be set to 'auto'" -}}
104104{{- end -}}
@@ -116,15 +116,15 @@ Pooler connections: For application traffic via PgBouncer
116116*/ }}
117117{{- define " cnpg-cluster.poolerConnections" -}}
118118{{- include " cnpg-cluster.validateConnections" . -}}
119- {{- $pooler := .Values.connections.pooler -}}
119+ {{- $pooler := .Values.connections.pooler | toString -}}
120120{{- if eq $pooler " auto" -}}
121121 {{- $max := include " cnpg-cluster.maxConnections" . | int -}}
122122 {{- $reserved := include " cnpg-cluster.reservedConnections" . | int -}}
123123 {{- $direct := .Values.connections.direct | int -}}
124124 {{- $remaining := sub (sub $max $reserved ) $direct -}}
125125 {{- if lt $remaining 0 }}0{{ else }}{{ $remaining }}{{ end }}
126126{{- else -}}
127- {{- $pooler | default 0 | int -}}
127+ {{- $pooler | int -}}
128128{{- end -}}
129129{{- end }}
130130
@@ -133,7 +133,7 @@ Direct connections: Calculated as remaining after reserved and pooler
133133*/ }}
134134{{- define " cnpg-cluster.directConnections" -}}
135135{{- include " cnpg-cluster.validateConnections" . -}}
136- {{- $direct := .Values.connections.direct -}}
136+ {{- $direct := .Values.connections.direct | toString -}}
137137{{- if eq $direct " auto" -}}
138138 {{- $max := include " cnpg-cluster.maxConnections" . | int -}}
139139 {{- $reserved := include " cnpg-cluster.reservedConnections" . | int -}}
0 commit comments