From 863bbc4154d6f65c0456bdd84f148b4890b23289 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Fri, 29 Sep 2023 00:51:09 +0200
Subject: [PATCH] fix(crowdsec): Switch to different patch system

---
 apps/base/crowdsec/release.yaml | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/apps/base/crowdsec/release.yaml b/apps/base/crowdsec/release.yaml
index cdfee9640..c34ce0ae0 100644
--- a/apps/base/crowdsec/release.yaml
+++ b/apps/base/crowdsec/release.yaml
@@ -33,18 +33,25 @@ spec:
       optional: true
   postRenderers:
     - kustomize:
-        patchesJson6902:
-          - target:
-              version: apps/v1
-              kind: DaemonSet
+        patchesStrategicMerge:
+          - kind: DaemonSet
+            apiVersion: apps/v1
+            metadata:
               name: crowdsec-agent
-            patch:
-              - op: "add"
-                path: /spec/template/spec/initContainers/0/resources/limits/cpu
-                value: "100m"
-              - op: "replace"
-                path: /spec/template/spec/containers/0/securityContext/privileged
-                value: true
+            spec:
+              template:
+                spec:
+                  initContainers:
+                    - name: wait-for-lapi
+                      resources:
+                        limits:
+                          cpu: "1"
+                  containers:
+                    - name: crowdsec-agent
+                      # Required in order to run as Super-Privileged-Container and therefore accessing host resources
+                      securityContext:
+                        privileged: true
+                        allowPrivilegeEscalation: true
 ---
 apiVersion: v1
 kind: ConfigMap
-- 
GitLab