Merge "Adapt git-gc script to work with ash"
diff --git a/container-images/gerrit-init/tools/gerrit-initializer/initializer/tasks/download_plugins.py b/container-images/gerrit-init/tools/gerrit-initializer/initializer/tasks/download_plugins.py
index 67ca573..819dfc1 100755
--- a/container-images/gerrit-init/tools/gerrit-initializer/initializer/tasks/download_plugins.py
+++ b/container-images/gerrit-init/tools/gerrit-initializer/initializer/tasks/download_plugins.py
@@ -232,7 +232,7 @@
         else:
             LOG.info("%s not found in cache. Downloading it.", plugin["name"])
             download_target = self._get_cached_plugin_path(plugin)
-            self._create_plugin_cache_dir(os.path.dirname(target))
+            self._create_plugin_cache_dir(os.path.dirname(download_target))
 
             lock_path = f"{download_target}.lock"
             while os.path.exists(lock_path):
diff --git a/helm-charts/gerrit/templates/gerrit.stateful-set.yaml b/helm-charts/gerrit/templates/gerrit.stateful-set.yaml
index 4e10ae6..b865c71 100644
--- a/helm-charts/gerrit/templates/gerrit.stateful-set.yaml
+++ b/helm-charts/gerrit/templates/gerrit.stateful-set.yaml
@@ -189,6 +189,10 @@
         - name: gerrit-index-config
           mountPath: "/var/mnt/index"
         {{- end }}
+        {{- if and .Values.gerrit.plugins.cache.enabled .Values.gerrit.plugins.downloaded }}
+        - name: gerrit-plugin-cache
+          mountPath: "/var/mnt/plugins"
+        {{- end }}
         - name: gerrit-config
           mountPath: "/var/mnt/etc/config"
         - name: gerrit-secure-config