From c5e777c9c5ea4f863be08edd148ff7d76f932b2a Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 16 Jan 2024 15:44:10 +0100 Subject: [PATCH] WIP: Add defn-spec for rate-limiting ingress --- src/main/cljc/dda/c4k_forgejo/forgejo.cljc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/cljc/dda/c4k_forgejo/forgejo.cljc b/src/main/cljc/dda/c4k_forgejo/forgejo.cljc index 23b370e..0953f98 100644 --- a/src/main/cljc/dda/c4k_forgejo/forgejo.cljc +++ b/src/main/cljc/dda/c4k_forgejo/forgejo.cljc @@ -119,6 +119,18 @@ :fqdns [fqdn]} config)))) +(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")))))) + (defn-spec generate-data-volume pred/map-or-seq? [config vol?] (let [{:keys [volume-total-storage-size]} config