From 43c63eb3e669bfc7d671956c69f18a1c73c416b8 Mon Sep 17 00:00:00 2001 From: kv-dhyey-moliya <135125196+kv-dhyey-moliya@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:02:58 +0530 Subject: [PATCH 1/2] Fix tolerations iteration issue for pg-db cluster template Instead of replacing with single value, read array of tolerations for pg-db cluster template. --- charts/pg-db/templates/cluster.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/charts/pg-db/templates/cluster.yaml b/charts/pg-db/templates/cluster.yaml index 04a16b8f..3f8b1d18 100644 --- a/charts/pg-db/templates/cluster.yaml +++ b/charts/pg-db/templates/cluster.yaml @@ -221,10 +221,12 @@ spec: {{- if $instance.tolerations }} tolerations: - - effect: {{ $instance.tolerations.effect }} - key: {{ $instance.tolerations.key }} - operator: {{ $instance.tolerations.operator }} - value: {{ $instance.tolerations.value }} + {{- range $toleration := $instance.tolerations }} + - effect: {{ $toleration.effect }} + key: {{ $toleration.key }} + operator: {{ $toleration.operator }} + value: {{ $toleration.value }} + {{- end }} {{- end }} {{- if $instance.priorityClassName }} @@ -353,10 +355,12 @@ spec: {{- end }} {{- if .Values.proxy.pgBouncer.tolerations }} tolerations: - - effect: {{ .Values.proxy.pgBouncer.tolerations.effect }} - key: {{ .Values.proxy.pgBouncer.tolerations.key }} - operator: {{ .Values.proxy.pgBouncer.tolerations.operator }} - value: {{ .Values.proxy.pgBouncer.tolerations.value }} + {{- range $toleration := .Values.proxy.pgBouncer.tolerations }} + - effect: {{ $toleration.effect }} + key: {{ $toleration.key }} + operator: {{ $toleration.operator }} + value: {{ $toleration.value }} + {{- end }} {{- end }} {{- if .Values.proxy.pgBouncer.securityContext }} securityContext: From 2a88d80f777cc87b3307ac59db306a32abbfeabc Mon Sep 17 00:00:00 2001 From: kv-dhyey-moliya <135125196+kv-dhyey-moliya@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:12:39 +0530 Subject: [PATCH 2/2] Update further toleration instances in the pg-db cluster template --- charts/pg-db/templates/cluster.yaml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/charts/pg-db/templates/cluster.yaml b/charts/pg-db/templates/cluster.yaml index 3f8b1d18..a5988f6c 100644 --- a/charts/pg-db/templates/cluster.yaml +++ b/charts/pg-db/templates/cluster.yaml @@ -222,10 +222,10 @@ spec: {{- if $instance.tolerations }} tolerations: {{- range $toleration := $instance.tolerations }} - - effect: {{ $toleration.effect }} - key: {{ $toleration.key }} - operator: {{ $toleration.operator }} - value: {{ $toleration.value }} + - effect: {{ $toleration.effect }} + key: {{ $toleration.key }} + operator: {{ $toleration.operator }} + value: {{ $toleration.value }} {{- end }} {{- end }} @@ -356,10 +356,10 @@ spec: {{- if .Values.proxy.pgBouncer.tolerations }} tolerations: {{- range $toleration := .Values.proxy.pgBouncer.tolerations }} - - effect: {{ $toleration.effect }} - key: {{ $toleration.key }} - operator: {{ $toleration.operator }} - value: {{ $toleration.value }} + - effect: {{ $toleration.effect }} + key: {{ $toleration.key }} + operator: {{ $toleration.operator }} + value: {{ $toleration.value }} {{- end }} {{- end }} {{- if .Values.proxy.pgBouncer.securityContext }} @@ -414,10 +414,12 @@ spec: memory: {{ .Values.backups.pgbackrest.jobs.resources.limits.memory }} {{- if .Values.backups.pgbackrest.jobs.tolerations }} tolerations: - - effect: {{ .Values.backups.pgbackrest.jobs.tolerations.effect }} - key: {{ .Values.backups.pgbackrest.jobs.tolerations.key }} - operator: {{ .Values.backups.pgbackrest.jobs.tolerations.operator }} - value: {{ .Values.backups.pgbackrest.jobs.tolerations.value }} + {{- range $toleration := .Values.backups.pgbackrest.jobs.tolerations }} + - effect: {{ $toleration.effect }} + key: {{ $toleration.key }} + operator: {{ $toleration.operator }} + value: {{ $toleration.value }} + {{- end }} {{- end }} {{- if .Values.backups.pgbackrest.jobs.securityContext }} securityContext: