Skip to content

Commit d9b3f95

Browse files
authored
Fixed indentation issue in the extraEnvVars field, preserved the serverDefinitions template, corrected a typo in README.md, and increased resource allocations in the Helm chart.
1 parent 986ba41 commit d9b3f95

File tree

5 files changed

+35
-11
lines changed

5 files changed

+35
-11
lines changed

pkg/helm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ The chart should dump its version and appVersion in the Chart.yaml file every re
3434
| `preferences.enabled` | Whether to mount preferences.json | `false` |
3535
| `preferences.data` | Preferences to load | `{}` |
3636
| `resources.*` | Allocated requests and limits resources | `{"requests": {...}, "limits": {...}}` |
37-
| `persistence.enabled` | PVC resource creation | `false` |
37+
| `persistence.enabled` | PVC resource creation | `true` |
3838
| `service.type` | Service type | `"ClusterIP"` |
3939
| `service.loadBalancerIP` | Load balancer IP (Only if service.type is LoadBalancer) | `""` |
4040
| `ingress.enabled` | Ingress resource creation | `false` |
41-
| `ingress.hostname` | Ingress resource hostname | `"pgadmin4.local"` |
41+
| `ingress.hostname` | Ingress resource hostname | `"pgadmin4.local"` |

pkg/helm/templates/_helpers.tpl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,25 @@
2525
{{- $securityContext = omit $securityContext "appArmorProfile" -}}
2626
{{- end -}}
2727
{{- $securityContext | toYaml -}}
28-
{{- end -}}
28+
{{- end -}}
29+
30+
{{- define "tpl.preserve.variable" -}}
31+
{{- $obj := . }}
32+
{{- if kindIs "map" $obj }}
33+
{{- range $k, $v := $obj }}
34+
{{- if kindIs "string" $v }}
35+
{{- if regexMatch "^[0-9]+$" $v }}
36+
{{- $_ := set $obj $k (atoi $v) }}
37+
{{- else if regexMatch "(?i)^(true|false)$" $v }}
38+
{{- $_ := set $obj $k (eq (lower $v) "true") }}
39+
{{- end }}
40+
{{- else }}
41+
{{- include "tpl.preserve.variable" $v }}
42+
{{- end }}
43+
{{- end }}
44+
{{- else if kindIs "slice" $obj }}
45+
{{- range $i, $v := $obj }}
46+
{{- include "tpl.preserve.variable" $v }}
47+
{{- end }}
48+
{{- end }}
49+
{{- end }}

pkg/helm/templates/configmap-serverDefinitions.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ metadata:
1010
annotations: {{ . | toYaml | nindent 4 }}
1111
{{- end }}
1212
data:
13-
servers.json: | {{ tpl (dict "Servers" .Values.serverDefinitions.data | toYaml) . | fromYaml | toPrettyJson | nindent 4 }}
13+
{{- $variableToPreserveTPL := tpl (dict "Servers" .Values.serverDefinitions.data | toYaml) . | fromYaml }}
14+
{{- include "tpl.preserve.variable" $variableToPreserveTPL }}
15+
servers.json: | {{ $variableToPreserveTPL | toYaml | nindent 4 }}
1416
{{- end }}

pkg/helm/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ spec:
117117
- name: PGADMIN_DISABLE_POSTFIX
118118
value: {{ .Values.disablePostfix | quote }}
119119
{{- with .Values.extraEnvVars }}
120-
{{- tpl (. | toYaml) $ | nindent 14 }}
120+
{{- tpl (. | toYaml) $ | nindent 12 }}
121121
{{- end }}
122122
volumeMounts:
123123
- mountPath: /var/lib/pgadmin
@@ -234,4 +234,4 @@ spec:
234234
type: RuntimeDefault
235235
{{- end }}
236236
windowsOptions:
237-
hostProcess: false
237+
hostProcess: false

pkg/helm/values.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ preferences:
7171

7272
resources:
7373
requests:
74-
cpu: 250m
75-
memory: 512Mi
74+
cpu: 500m
75+
memory: 1Gi
7676
limits:
77-
cpu: 250m
78-
memory: 512Mi
77+
cpu: 500m
78+
memory: 1Gi
7979

8080
persistence:
8181
enabled: true
@@ -152,4 +152,5 @@ containerSecurityContext:
152152
appArmorProfile:
153153
type: RuntimeDefault
154154
windowsOptions:
155-
hostProcess: false
155+
156+
hostProcess: false

0 commit comments

Comments
 (0)