From 93ba5291e5c0d7aeff34e2051d65dbacdcbaed30 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Tue, 15 Nov 2022 05:12:13 +0100
Subject: [PATCH] fix(mastodon): Fix resources defaults for sidekiq deployments

This patch fixes the missing declaration of defaults for the
container resources in the sidekiq deployment. Rendering the
explicitly set resource requests and limits unused.
---
 charts/mastodon/Chart.yaml                        | 2 +-
 charts/mastodon/README.md                         | 2 +-
 charts/mastodon/templates/deployment-sidekiq.yaml | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/charts/mastodon/Chart.yaml b/charts/mastodon/Chart.yaml
index 02da22d1a..bb850c999 100644
--- a/charts/mastodon/Chart.yaml
+++ b/charts/mastodon/Chart.yaml
@@ -15,7 +15,7 @@ type: application
 # This is the chart version. This version number should be incremented each time you make changes
 # to the chart and its templates, including the app version.
 # Versions are expected to follow Semantic Versioning (https://semver.org/)
-version: 3.0.2
+version: 3.0.3
 
 # This is the version number of the application being deployed. This version number should be
 # incremented each time you make changes to the application. Versions are not expected to
diff --git a/charts/mastodon/README.md b/charts/mastodon/README.md
index a66ab4f04..6ab99d18a 100644
--- a/charts/mastodon/README.md
+++ b/charts/mastodon/README.md
@@ -1,6 +1,6 @@
 # mastodon
 
-![Version: 3.0.2](https://img.shields.io/badge/Version-3.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v3.5.3](https://img.shields.io/badge/AppVersion-v3.5.3-informational?style=flat-square)
+![Version: 3.0.3](https://img.shields.io/badge/Version-3.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v3.5.3](https://img.shields.io/badge/AppVersion-v3.5.3-informational?style=flat-square)
 
 Mastodon is a free, open-source social network server based on ActivityPub.
 
diff --git a/charts/mastodon/templates/deployment-sidekiq.yaml b/charts/mastodon/templates/deployment-sidekiq.yaml
index 9675e5701..8180b62e2 100644
--- a/charts/mastodon/templates/deployment-sidekiq.yaml
+++ b/charts/mastodon/templates/deployment-sidekiq.yaml
@@ -120,7 +120,7 @@ spec:
               mountPath: /opt/mastodon/public/system
           {{- end }}
           resources:
-            {{- toYaml .resources | nindent 12 }}
+            {{- toYaml (default (default $context.resources $context.mastodon.sidekiq.resources) .resources) | nindent 12 }}
       {{- with $context.Values.nodeSelector }}
       nodeSelector:
         {{- toYaml . | nindent 8 }}
-- 
GitLab