From 289d083da55660049ded5ba40e1e1a057979201f Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Thu, 5 Oct 2023 22:19:20 +0200
Subject: [PATCH] fix(mastodon): Fix forgotten `emptyDir` vs `emptydir`

---
 charts/mastodon/Chart.yaml                          |  2 +-
 charts/mastodon/README.md                           |  4 ++--
 charts/mastodon/tests/50_web_test.yaml              | 13 ++++++++++++-
 .../tests/__snapshot__/50_web_test.yaml.snap        |  7 ++-----
 .../__snapshot__/80_subchart_redis_test.yaml.snap   |  2 +-
 .../tests/__snapshot__/98_snapshot_test.yaml.snap   |  4 ++--
 charts/mastodon/values.yaml                         |  4 ++--
 7 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/charts/mastodon/Chart.yaml b/charts/mastodon/Chart.yaml
index 06d7945f5..58609c5de 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: 7.2.2
+version: 7.2.3
 kubeVersion: ">= 1.23"
 # renovate: image=ghcr.io/mastodon/mastodon
 appVersion: "v4.1.9"
diff --git a/charts/mastodon/README.md b/charts/mastodon/README.md
index 8494e21d6..55a730d64 100644
--- a/charts/mastodon/README.md
+++ b/charts/mastodon/README.md
@@ -1,6 +1,6 @@
 # mastodon
 
-![Version: 7.2.2](https://img.shields.io/badge/Version-7.2.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.1.9](https://img.shields.io/badge/AppVersion-v4.1.9-informational?style=flat-square)
+![Version: 7.2.3](https://img.shields.io/badge/Version-7.2.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.1.9](https://img.shields.io/badge/AppVersion-v4.1.9-informational?style=flat-square)
 
 Mastodon is a free, open-source social network server based on ActivityPub.
 
@@ -112,7 +112,7 @@ Kubernetes: `>= 1.23`
 | mastodon.web.replicas | int | `1` | Number of Web Pods running |
 | mastodon.web.resources | Web Container | `{}` | Resources for Web Pods, overwrites .Values.resources |
 | mastodon.web.securityContext | Web Container | `{"readOnlyRootFilesystem":true}` | Security Context for Web Pods, overwrites .Values.securityContext |
-| mastodon.web.temporaryVolumeTemplate | object | `{"emptydir":{"medium":"Memory"}}` | temporary volume template required for read-only root filesystem |
+| mastodon.web.temporaryVolumeTemplate | object | `{"emptyDir":{"medium":"Memory"}}` | temporary volume template required for read-only root filesystem |
 | mastodon.web_domain | string | `nil` | Use of WEB_DOMAIN requires careful consideration: https://docs.joinmastodon.org/admin/config/#federation You must redirect the path LOCAL_DOMAIN/.well-known/ to WEB_DOMAIN/.well-known/ as described Example: mastodon.example.com |
 | podAnnotations | object | `{}` | Kubernetes manages pods for jobs and pods for deployments differently, so you might need to apply different annotations to the two different sets of pods. The annotations set with podAnnotations will be added to all deployment-managed pods. |
 | podSecurityContext | object | `{"fsGroup":991,"runAsGroup":991,"runAsNonRoot":true,"runAsUser":991,"seccompProfile":{"type":"RuntimeDefault"}}` | base securityContext on Pod-Level. Can be overwritten but more specific contexts. Used to match the Upstream UID/GID |
diff --git a/charts/mastodon/tests/50_web_test.yaml b/charts/mastodon/tests/50_web_test.yaml
index 8e98ee2c3..c658a19ea 100644
--- a/charts/mastodon/tests/50_web_test.yaml
+++ b/charts/mastodon/tests/50_web_test.yaml
@@ -64,7 +64,7 @@ tests:
       mastodon:
         sidekiq:
           temporaryVolumeTemplate:
-            emptydir: null
+            emptyDir: null
             some:
               nonsense: true
         web:
@@ -86,3 +86,14 @@ tests:
         - networking.k8s.io/v1/Ingress
     asserts:
       - matchSnapshot: {}
+      - equal:
+          path: spec.template.spec.volumes[2].ephemeral
+          value:
+            volumeClaimTemplate:
+              spec:
+                accessModes:
+                  - ReadWriteOnce
+                resources:
+                  requests:
+                    storage: 5Gi
+        template: deployment-web.yaml
diff --git a/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap b/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap
index e7bf6bd2f..55b5d971d 100644
--- a/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap
+++ b/charts/mastodon/tests/__snapshot__/50_web_test.yaml.snap
@@ -139,10 +139,7 @@ should allow manipulating the temporaryVolumeTemplate:
             - name: system
               persistentVolumeClaim:
                 claimName: RELEASE-NAME-mastodon-system
-            - emptyDir: null
-              emptydir:
-                medium: Memory
-              ephemeral:
+            - ephemeral:
                 volumeClaimTemplate:
                   spec:
                     accessModes:
@@ -386,7 +383,7 @@ should match basic snapshot:
             - name: system
               persistentVolumeClaim:
                 claimName: RELEASE-NAME-mastodon-system
-            - emptydir:
+            - emptyDir:
                 medium: Memory
               name: tmp
   3: |
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 207cee42f..a84ce1c13 100644
--- a/charts/mastodon/tests/__snapshot__/80_subchart_redis_test.yaml.snap
+++ b/charts/mastodon/tests/__snapshot__/80_subchart_redis_test.yaml.snap
@@ -271,6 +271,6 @@ should allow disabling redis auth:
             - name: system
               persistentVolumeClaim:
                 claimName: RELEASE-NAME-mastodon-system
-            - emptydir:
+            - emptyDir:
                 medium: Memory
               name: tmp
diff --git a/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap b/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap
index af762e200..36f8da487 100644
--- a/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap
+++ b/charts/mastodon/tests/__snapshot__/98_snapshot_test.yaml.snap
@@ -403,7 +403,7 @@ should match basic snapshot:
             - name: system
               persistentVolumeClaim:
                 claimName: RELEASE-NAME-mastodon-system
-            - emptydir:
+            - emptyDir:
                 medium: Memory
               name: tmp
   6: |
@@ -1377,7 +1377,7 @@ should match basic snapshot without dependencies:
             - name: system
               persistentVolumeClaim:
                 claimName: RELEASE-NAME-mastodon-system
-            - emptydir:
+            - emptyDir:
                 medium: Memory
               name: tmp
   6: |
diff --git a/charts/mastodon/values.yaml b/charts/mastodon/values.yaml
index 24904d7c9..c5840c191 100644
--- a/charts/mastodon/values.yaml
+++ b/charts/mastodon/values.yaml
@@ -200,8 +200,8 @@ mastodon:
       readOnlyRootFilesystem: true
     # -- temporary volume template required for read-only root filesystem
     temporaryVolumeTemplate:
-      # emptydir is currently limited to medium Memory due to a Ruby special handling of temporary directories, alternatively use a generic ephemeral volume: https://shivering-isles.com/about-read-only-containers-ruby-and-emptydir
-      emptydir:
+      # emptyDir is currently limited to medium Memory due to a Ruby special handling of temporary directories, alternatively use a generic ephemeral volume: https://shivering-isles.com/about-read-only-containers-ruby-and-emptydir
+      emptyDir:
         medium: Memory
       # ephemeral:
       #   volumeClaimTemplate:
-- 
GitLab