|
|
@ -40,14 +40,14 @@
|
|
|
|
::build-memory-limit]))
|
|
|
|
::build-memory-limit]))
|
|
|
|
(def websiteauth? (s/keys :req-un [::unique-name ::username ::authtoken]))
|
|
|
|
(def websiteauth? (s/keys :req-un [::unique-name ::username ::authtoken]))
|
|
|
|
(s/def ::websiteconfigs (s/coll-of websiteconfig?))
|
|
|
|
(s/def ::websiteconfigs (s/coll-of websiteconfig?))
|
|
|
|
(s/def ::auth (s/coll-of websiteauth?))
|
|
|
|
(s/def ::websiteauths (s/coll-of websiteauth?))
|
|
|
|
|
|
|
|
|
|
|
|
(def config? (s/keys :req-un [::websiteconfigs]
|
|
|
|
(def config? (s/keys :req-un [::websiteconfigs]
|
|
|
|
:opt-un [::issuer
|
|
|
|
:opt-un [::issuer
|
|
|
|
::volume-size
|
|
|
|
::volume-size
|
|
|
|
::mon-cfg]))
|
|
|
|
::mon-cfg]))
|
|
|
|
|
|
|
|
|
|
|
|
(def auth? (s/keys :req-un [::auth]
|
|
|
|
(def auth? (s/keys :req-un [::websiteauths]
|
|
|
|
:opt-un [::mon-auth]))
|
|
|
|
:opt-un [::mon-auth]))
|
|
|
|
|
|
|
|
|
|
|
|
(def config-defaults {:issuer "staging"})
|
|
|
|
(def config-defaults {:issuer "staging"})
|
|
|
@ -68,9 +68,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
(defn-spec sort-auth map?
|
|
|
|
(defn-spec sort-auth map?
|
|
|
|
[unsorted-auth auth?]
|
|
|
|
[unsorted-auth auth?]
|
|
|
|
(let [sorted-auth (into [] (sort-by :unique-name (unsorted-auth :auth)))]
|
|
|
|
(let [sorted-auth (into [] (sort-by :unique-name (unsorted-auth :websiteauths)))]
|
|
|
|
(-> unsorted-auth
|
|
|
|
(-> unsorted-auth
|
|
|
|
(assoc-in [:auth] sorted-auth))))
|
|
|
|
(assoc-in [:websiteauths] sorted-auth))))
|
|
|
|
|
|
|
|
|
|
|
|
(defn-spec flatten-and-reduce-config map?
|
|
|
|
(defn-spec flatten-and-reduce-config map?
|
|
|
|
[config config?]
|
|
|
|
[config config?]
|
|
|
@ -84,7 +84,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
(defn-spec flatten-and-reduce-auth map?
|
|
|
|
(defn-spec flatten-and-reduce-auth map?
|
|
|
|
[auth auth?]
|
|
|
|
[auth auth?]
|
|
|
|
(-> auth :auth first))
|
|
|
|
(-> auth :websiteauths first))
|
|
|
|
|
|
|
|
|
|
|
|
(defn-spec generate-ingress seq?
|
|
|
|
(defn-spec generate-ingress seq?
|
|
|
|
[config websiteconfig?]
|
|
|
|
[config websiteconfig?]
|
|
|
@ -103,14 +103,14 @@
|
|
|
|
sorted-auth (sort-auth auth)
|
|
|
|
sorted-auth (sort-auth auth)
|
|
|
|
result []]
|
|
|
|
result []]
|
|
|
|
|
|
|
|
|
|
|
|
(if (and (empty? (config :websiteconfigs)) (empty? (sorted-auth :auth)))
|
|
|
|
(if (and (empty? (config :websiteconfigs)) (empty? (sorted-auth :websiteauths)))
|
|
|
|
result
|
|
|
|
result
|
|
|
|
(recur (->
|
|
|
|
(recur (->
|
|
|
|
config
|
|
|
|
config
|
|
|
|
(assoc-in [:websiteconfigs] (rest (config :websiteconfigs))))
|
|
|
|
(assoc-in [:websiteconfigs] (rest (config :websiteconfigs))))
|
|
|
|
(->
|
|
|
|
(->
|
|
|
|
auth
|
|
|
|
auth
|
|
|
|
(assoc-in [:auth] (rest (sorted-auth :auth))))
|
|
|
|
(assoc-in [:websiteauths] (rest (sorted-auth :websiteauths))))
|
|
|
|
(let [final-config
|
|
|
|
(let [final-config
|
|
|
|
(merge
|
|
|
|
(merge
|
|
|
|
website-config-defaults
|
|
|
|
website-config-defaults
|
|
|
|