From 13e718ca37b02a83a1d8e2731f1ca98e7af1aa1e Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 17 Jan 2024 11:40:58 +0100 Subject: [PATCH] Implement rate limit ingress --- src/main/cljc/dda/c4k_forgejo/forgejo.cljc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/cljc/dda/c4k_forgejo/forgejo.cljc b/src/main/cljc/dda/c4k_forgejo/forgejo.cljc index 515d370..1368396 100644 --- a/src/main/cljc/dda/c4k_forgejo/forgejo.cljc +++ b/src/main/cljc/dda/c4k_forgejo/forgejo.cljc @@ -125,15 +125,13 @@ (defn-spec generate-rate-limit-ingress-and-cert pred/map-or-seq? [config config?] - (let [{:keys [fqdn average burst period]} config] - (-> - (generate-ingress-and-cert config) - (#(cm/replace-key-value % - :traefik.ingress.kubernetes.io/router.middlewares - (str - (:traefik.ingress.kubernetes.io/router.middlewares - (:annotations (:metadata %))) - ", default-ratelimit@kubernetescrd")))))) ; ToDo: Rate Limit Konfig Optionen + (-> + (generate-ingress-and-cert config) ; returns a vector + (#(assoc-in % ; Attention: heavily relying on the output order of ing/generate-ingress-and-cert + [1 :metadata :annotations :traefik.ingress.kubernetes.io/router.middlewares] + (str + (-> (second %) :metadata :annotations :traefik.ingress.kubernetes.io/router.middlewares) + ", default-ratelimit@kubernetescrd"))))) (defn-spec generate-data-volume pred/map-or-seq? [config vol?]