Compare commits

..

No commits in common. "d2bf694e4e8b44f8a7de0372b81ce04dd1726c3e" and "0b647ed4d8eb2ce828ee0b353fc3e08d70b76456" have entirely different histories.

3 changed files with 8 additions and 9 deletions

View file

@ -31,9 +31,9 @@
[coll cp/map-or-seq?
match-value string?
replace-value cp/str-or-number?]
(clojure.walk/postwalk #(if (and (= (type match-value) (type %))
(= match-value %))
replace-value
(clojure.walk/postwalk #(if (and (= (type value-to-match) (type %))
(= value-to-match %))
value-to-replace
%)
coll))

View file

@ -17,7 +17,7 @@
(s/def ::burst-rate ::int/burst-rate)
(def simple-ingress? (s/keys :req-un [::fqdns ::service-name ::service-port]
:opt-un [::issuer ::average-rate ::burst-rate ::ns/namespace]))
:opt-un [::issuer ::average-rate ::ns/namespace]))
(def ingress? (s/keys :req-un [::fqdns ::app-name ::ingress-name ::service-name ::service-port]
:opt-un [::issuer ::cert-name ::rate-limit-name ::ns/namespace]))
@ -32,8 +32,7 @@
(def default-config
(merge ns/default-config
{:issuer "staging"
:average-rate 10
:burst-rate 20}))
:average-rate 10}))
(defn-spec generate-certificate map?
@ -71,10 +70,10 @@
:rate-limit-name service-name}
default-config
config)
{:keys [average-rate burst-rate]} final-config]
{:keys [average-rate]} final-config]
[(int/generate-certificate final-config)
(int/generate-rate-limit-middleware {:rate-limit-name service-name
:namespace (:namespace final-config)
:average-rate average-rate
:burst-rate burst-rate})
:burst-rate average-rate})
(int/generate-ingress final-config)]))

View file

@ -101,7 +101,7 @@
:kind "Middleware",
:metadata {:name "web-ratelimit"
:namespace "default"},
:spec {:rateLimit {:average 10, :burst 20}}}
:spec {:rateLimit {:average 10, :burst 10}}}
{:apiVersion "networking.k8s.io/v1",
:kind "Ingress",
:metadata