diff --git a/rflood/Chart.yaml b/rflood/Chart.yaml index a45efb3..752e1be 100644 --- a/rflood/Chart.yaml +++ b/rflood/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: rflood description: rTorrent + Flood (jesec/rtorrent-flood) Helm chart type: application -version: 0.2.3 +version: 0.2.4 appVersion: "4.14.2" annotations: version-source: dockerhub-tags-pattern:jesec/rtorrent-flood:^[0-9]+\.[0-9]+\.[0-9]+$ diff --git a/rflood/templates/deployment.yaml b/rflood/templates/deployment.yaml index e782ee8..2596f93 100644 --- a/rflood/templates/deployment.yaml +++ b/rflood/templates/deployment.yaml @@ -37,6 +37,17 @@ spec: affinity: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + # An unclean stop (node reboot, OOM kill) leaves a stale lock and socket on the config volume. + # rTorrent then refuses to start. The Recreate strategy and the RWO volume guarantee that no other + # rTorrent uses this session directory, so removing both files is safe. + - name: clean-stale-locks + image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["sh", "-c", "rm -f /config/session/rtorrent.lock {{ .Values.rtorrentSocket }}"] + volumeMounts: + - name: config + mountPath: /config containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"