From cbf49d41cfefcaa880a6d32967ebd2baf0373945 Mon Sep 17 00:00:00 2001
From: Janne Mareike Koschinski <janne@kuschku.de>
Date: Fri, 16 Dec 2022 21:09:31 +0100
Subject: [PATCH] fix: correct issue with restarts of mastodon chart

---
 mastodon/Chart.yaml                    | 2 +-
 mastodon/templates/deployment-web.yaml | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/mastodon/Chart.yaml b/mastodon/Chart.yaml
index 2e029b7..ebd04f1 100644
--- a/mastodon/Chart.yaml
+++ b/mastodon/Chart.yaml
@@ -2,5 +2,5 @@ apiVersion: v2
 name: mastodon
 description: Helm Chart for mastodon
 type: application
-version: 0.3.0
+version: 0.3.1
 appVersion: "v4.0"
diff --git a/mastodon/templates/deployment-web.yaml b/mastodon/templates/deployment-web.yaml
index 4d99db6..b77aba7 100644
--- a/mastodon/templates/deployment-web.yaml
+++ b/mastodon/templates/deployment-web.yaml
@@ -33,6 +33,14 @@ spec:
         - name: tmp
           emptyDir:
             medium: Memory
+      initContainers:
+        - name: clear-tmp
+          image: alpine:latest
+          imagePullPolicy: Always
+          command:
+            - rm
+            - -f
+            - /opt/mastodon/tmp/pids/server.pid
       containers:
         - name: {{ .Chart.Name }}
           securityContext:
-- 
GitLab