From 119394ff1f2d4282e7e6a7d0cb82b6a49283ceac Mon Sep 17 00:00:00 2001
From: Janne Mareike Koschinski <janne@kuschku.de>
Date: Mon, 19 Dec 2022 19:03:52 +0100
Subject: [PATCH] fix: correct restart issue for mastodon

---
 mastodon/Chart.yaml                    |  2 +-
 mastodon/templates/deployment-web.yaml | 20 ++++----------------
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/mastodon/Chart.yaml b/mastodon/Chart.yaml
index ebd04f1..49e701a 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.1
+version: 0.3.2
 appVersion: "v4.0"
diff --git a/mastodon/templates/deployment-web.yaml b/mastodon/templates/deployment-web.yaml
index b77aba7..5d22d4f 100644
--- a/mastodon/templates/deployment-web.yaml
+++ b/mastodon/templates/deployment-web.yaml
@@ -31,16 +31,7 @@ spec:
         - name: data
           {{- .Values.volumes.data | nindent 10 }}
         - name: tmp
-          emptyDir:
-            medium: Memory
-      initContainers:
-        - name: clear-tmp
-          image: alpine:latest
-          imagePullPolicy: Always
-          command:
-            - rm
-            - -f
-            - /opt/mastodon/tmp/pids/server.pid
+          emptyDir: {}
       containers:
         - name: {{ .Chart.Name }}
           securityContext:
@@ -48,12 +39,9 @@ spec:
           image: "{{ .Values.web.repository }}:{{ .Values.web.tag | default .Chart.AppVersion }}"
           imagePullPolicy: {{ .Values.web.pullPolicy }}
           command:
-            - "bundle"
-            - "exec"
-            - "rails"
-            - "s"
-            - "-p"
-            - "3000"
+            - "sh"
+            - "-c"
+            - "rm -f /mastodon/tmp/pids/server.pid; exec bundle exec rails s -p 3000"
           envFrom:
             - secretRef:
                 name: {{ include "mastodon-helm.fullname" . }}
-- 
GitLab