From 4b6b17201924c1b59f07b39292912411486f9df1 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Wed, 9 Apr 2025 22:46:06 +0200
Subject: [PATCH] fix(mastodon): According to upstream, the DB_POOL veriable is
 optional

Reference:
https://github.com/mastodon/chart/pull/190
---
 charts/mastodon/Chart.yaml                         |  2 +-
 charts/mastodon/README.md                          |  4 +++-
 charts/mastodon/templates/_helpers.tpl             | 12 ------------
 charts/mastodon/templates/configmap-env.yaml       |  1 -
 .../tests/__snapshot__/50_sidekiq_test.yaml.snap   | 13 +++++--------
 .../tests/__snapshot__/50_web_test.yaml.snap       |  6 ++----
 .../__snapshot__/80_subchart_redis_test.yaml.snap  |  6 +++---
 .../tests/__snapshot__/98_snapshot_test.yaml.snap  | 14 ++++++--------
 8 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/charts/mastodon/Chart.yaml b/charts/mastodon/Chart.yaml
index c2489418f..081ad0ea2 100644
--- a/charts/mastodon/Chart.yaml
+++ b/charts/mastodon/Chart.yaml
@@ -17,7 +17,7 @@ annotations:
     - name: support
       url: https://matrix.to/#/#mastodon-on-kubernetes:shivering-isles.com
 type: application
-version: 10.0.12
+version: 10.0.13
 kubeVersion: ">= 1.23"
 # renovate: image=ghcr.io/mastodon/mastodon
 appVersion: "v4.3.7"
diff --git a/charts/mastodon/README.md b/charts/mastodon/README.md
index 2f805b2ac..e9f2c4665 100644
--- a/charts/mastodon/README.md
+++ b/charts/mastodon/README.md
@@ -1,6 +1,6 @@
 # mastodon
 
-![Version: 10.0.12](https://img.shields.io/badge/Version-10.0.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.3.7](https://img.shields.io/badge/AppVersion-v4.3.7-informational?style=flat-square)
+![Version: 10.0.13](https://img.shields.io/badge/Version-10.0.13-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.3.7](https://img.shields.io/badge/AppVersion-v4.3.7-informational?style=flat-square)
 
 Mastodon is a free, open-source social network server based on ActivityPub.
 
@@ -140,3 +140,5 @@ Kubernetes: `>= 1.23`
 | serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
 | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
 
+----------------------------------------------
+Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
diff --git a/charts/mastodon/templates/_helpers.tpl b/charts/mastodon/templates/_helpers.tpl
index ceb3af28f..887772a4d 100644
--- a/charts/mastodon/templates/_helpers.tpl
+++ b/charts/mastodon/templates/_helpers.tpl
@@ -128,18 +128,6 @@ Return true if a mastodon secret object should be created
 {{- end -}}
 {{- end -}}
 
-{{/*
-Find highest number of needed database connections to set DB_POOL variable
-*/}}
-{{- define "mastodon.maxDbPool" -}}
-{{/* Default MAX_THREADS for Puma is 5 */}}
-{{- $poolSize := 5 }}
-{{- range .Values.mastodon.sidekiq.workers }}
-{{- $poolSize = max $poolSize .concurrency }}
-{{- end }}
-{{- $poolSize | quote }}
-{{- end }}
-
 {{- define "mastodon.nonS3MediaVolumes" -}}
 {{- if (not .Values.mastodon.s3.enabled) }}
 - name: assets
diff --git a/charts/mastodon/templates/configmap-env.yaml b/charts/mastodon/templates/configmap-env.yaml
index 3d0d6060f..88072c1ef 100644
--- a/charts/mastodon/templates/configmap-env.yaml
+++ b/charts/mastodon/templates/configmap-env.yaml
@@ -13,7 +13,6 @@ data:
   DB_PORT: {{ .Values.postgresql.postgresqlPort | default "5432" | quote }}
   {{- end }}
   DB_NAME: {{ .Values.postgresql.auth.database }}
-  DB_POOL: {{ include "mastodon.maxDbPool" . }}
   DB_USER: {{ .Values.postgresql.auth.username }}
   PREPARED_STATEMENTS: {{ .Values.mastodon.preparedStatements | quote }}
   DEFAULT_LOCALE: {{ .Values.mastodon.locale }}
diff --git a/charts/mastodon/tests/__snapshot__/50_sidekiq_test.yaml.snap b/charts/mastodon/tests/__snapshot__/50_sidekiq_test.yaml.snap
index 5642a30f3..b160091dd 100644
--- a/charts/mastodon/tests/__snapshot__/50_sidekiq_test.yaml.snap
+++ b/charts/mastodon/tests/__snapshot__/50_sidekiq_test.yaml.snap
@@ -4,7 +4,6 @@ allows to modify the temporaryVolumeTemplate correctly:
     data:
       DB_HOST: RELEASE-NAME-postgresql
       DB_NAME: mastodon_production
-      DB_POOL: "25"
       DB_PORT: "5432"
       DB_USER: mastodon
       DEFAULT_LOCALE: en
@@ -59,7 +58,7 @@ allows to modify the temporaryVolumeTemplate correctly:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: sidekiq-scheduler
@@ -167,7 +166,7 @@ allows to modify the temporaryVolumeTemplate correctly:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: sidekiq-default
@@ -319,7 +318,6 @@ renders temporaryVolumeTemplate correctly:
     data:
       DB_HOST: RELEASE-NAME-postgresql
       DB_NAME: mastodon_production
-      DB_POOL: "25"
       DB_PORT: "5432"
       DB_USER: mastodon
       DEFAULT_LOCALE: en
@@ -379,7 +377,7 @@ renders temporaryVolumeTemplate correctly:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e57a3719e3b525e43246b678c8be2067a38efc95b4f24b59725f193ec7674dc5
+            checksum/config-configmap: e67b93f4193edd836b87913b303beb95a25103c96f5824f1bc357ad0d4aad3a2
             checksum/config-secrets: 8883ef5b5307b7d9dee5aa2e003586bcaea9d609e48d3a37320bf05a4dd4a8d3
           labels:
             app.kubernetes.io/component: sidekiq-scheduler
@@ -471,7 +469,7 @@ renders temporaryVolumeTemplate correctly:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e57a3719e3b525e43246b678c8be2067a38efc95b4f24b59725f193ec7674dc5
+            checksum/config-configmap: e67b93f4193edd836b87913b303beb95a25103c96f5824f1bc357ad0d4aad3a2
             checksum/config-secrets: 8883ef5b5307b7d9dee5aa2e003586bcaea9d609e48d3a37320bf05a4dd4a8d3
           labels:
             app.kubernetes.io/component: sidekiq-default
@@ -609,7 +607,6 @@ should match basic snapshot:
     data:
       DB_HOST: RELEASE-NAME-postgresql
       DB_NAME: mastodon_production
-      DB_POOL: "25"
       DB_PORT: "5432"
       DB_USER: mastodon
       DEFAULT_LOCALE: en
@@ -662,7 +659,7 @@ should match basic snapshot:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: sidekiq-all-queues
diff --git a/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap b/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap
index 94644f813..55d055e71 100644
--- a/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap
+++ b/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap
@@ -4,7 +4,6 @@ should allow manipulating the temporaryVolumeTemplate:
     data:
       DB_HOST: RELEASE-NAME-postgresql
       DB_NAME: mastodon_production
-      DB_POOL: "25"
       DB_PORT: "5432"
       DB_USER: mastodon
       DEFAULT_LOCALE: en
@@ -55,7 +54,7 @@ should allow manipulating the temporaryVolumeTemplate:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: web
@@ -248,7 +247,6 @@ should match basic snapshot:
     data:
       DB_HOST: RELEASE-NAME-postgresql
       DB_NAME: mastodon_production
-      DB_POOL: "25"
       DB_PORT: "5432"
       DB_USER: mastodon
       DEFAULT_LOCALE: en
@@ -299,7 +297,7 @@ should match basic snapshot:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: web
diff --git a/charts/mastodon/tests/__snapshot__/80_subchart_redis_test.yaml.snap b/charts/mastodon/tests/__snapshot__/80_subchart_redis_test.yaml.snap
index d01d45488..11e88e142 100644
--- a/charts/mastodon/tests/__snapshot__/80_subchart_redis_test.yaml.snap
+++ b/charts/mastodon/tests/__snapshot__/80_subchart_redis_test.yaml.snap
@@ -23,7 +23,7 @@ should allow disabling redis auth:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: sidekiq-all-queues
@@ -128,7 +128,7 @@ should allow disabling redis auth:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: streaming
@@ -203,7 +203,7 @@ should allow disabling redis auth:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: web
diff --git a/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap b/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap
index ab145000e..dc3d45b7a 100644
--- a/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap
+++ b/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap
@@ -4,7 +4,6 @@ should match basic snapshot:
     data:
       DB_HOST: RELEASE-NAME-postgresql
       DB_NAME: mastodon_production
-      DB_POOL: "25"
       DB_PORT: "5432"
       DB_USER: mastodon
       DEFAULT_LOCALE: en
@@ -145,7 +144,7 @@ should match basic snapshot:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: sidekiq-all-queues
@@ -255,7 +254,7 @@ should match basic snapshot:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: streaming
@@ -335,7 +334,7 @@ should match basic snapshot:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: e95945d1de1fe21a68c3dc644c6b93291e3343e19569236e8d7df3e7462b788a
+            checksum/config-configmap: 18e407a31cba592b01cf377f4424888d4e28bf807eb11de6ac6e47123750ffed
             checksum/config-secrets: 77ec72a6b736b1458649608ddd74a07a68642c4fb1f80bba61deb8a0b6fbf859
           labels:
             app.kubernetes.io/component: web
@@ -925,7 +924,6 @@ should match basic snapshot without dependencies:
     data:
       DB_HOST: null
       DB_NAME: mastodon_production
-      DB_POOL: "25"
       DB_PORT: "5432"
       DB_USER: mastodon
       DEFAULT_LOCALE: en
@@ -1065,7 +1063,7 @@ should match basic snapshot without dependencies:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: 66a1c311104db4089be9d856e583f4ce5ece69d984ca888c5c9e8f8ffab790a4
+            checksum/config-configmap: 272805608de9f841638a18be2c6979cad824453dc9257635183c19542d097aa5
             checksum/config-secrets: 0dce86e2b7a8326a99c5e544117cfd4cbe223f28236f15675c27f06fee0e956c
           labels:
             app.kubernetes.io/component: sidekiq-all-queues
@@ -1175,7 +1173,7 @@ should match basic snapshot without dependencies:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: 66a1c311104db4089be9d856e583f4ce5ece69d984ca888c5c9e8f8ffab790a4
+            checksum/config-configmap: 272805608de9f841638a18be2c6979cad824453dc9257635183c19542d097aa5
             checksum/config-secrets: 0dce86e2b7a8326a99c5e544117cfd4cbe223f28236f15675c27f06fee0e956c
           labels:
             app.kubernetes.io/component: streaming
@@ -1255,7 +1253,7 @@ should match basic snapshot without dependencies:
       template:
         metadata:
           annotations:
-            checksum/config-configmap: 66a1c311104db4089be9d856e583f4ce5ece69d984ca888c5c9e8f8ffab790a4
+            checksum/config-configmap: 272805608de9f841638a18be2c6979cad824453dc9257635183c19542d097aa5
             checksum/config-secrets: 0dce86e2b7a8326a99c5e544117cfd4cbe223f28236f15675c27f06fee0e956c
           labels:
             app.kubernetes.io/component: web
-- 
GitLab