Skip to content

Commit f3d3cde

Browse files
committed
chart: bump version to 0.3.2 and update connection validation logic to ensure proper type handling
1 parent d45e9c9 commit f3d3cde

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

charts/cnpg-cluster/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.3.1
18+
version: 0.3.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/cnpg-cluster/templates/_helpers.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ Formula: (~totalMemoryMB / 10) capped between 25-200
9797
Validate 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

Comments
 (0)