|
|
|
@ -7,7 +7,6 @@
|
|
|
|
|
:cljs [orchestra.core :refer-macros [defn-spec]])
|
|
|
|
|
[dda.c4k-common.predicate :as cp]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; deprecated functions were moved to dda.c4k-common.predicate
|
|
|
|
|
(defn ^{:deprecated "0.1"} bash-env-string?
|
|
|
|
|
[input]
|
|
|
|
@ -26,7 +25,7 @@
|
|
|
|
|
(defn-spec replace-named-value cp/map-or-seq?
|
|
|
|
|
[coll cp/map-or-seq?
|
|
|
|
|
name string?
|
|
|
|
|
value string?]
|
|
|
|
|
value cp/str-or-number?]
|
|
|
|
|
(clojure.walk/postwalk #(if (and (map? %)
|
|
|
|
|
(= name (:name %)))
|
|
|
|
|
{:name name :value value}
|
|
|
|
@ -36,7 +35,7 @@
|
|
|
|
|
(defn-spec replace-key-value cp/map-or-seq?
|
|
|
|
|
[coll cp/map-or-seq?
|
|
|
|
|
key keyword?
|
|
|
|
|
value string?]
|
|
|
|
|
value cp/str-or-number?]
|
|
|
|
|
(clojure.walk/postwalk #(if (and (map? %)
|
|
|
|
|
(contains? % key))
|
|
|
|
|
(assoc % key value)
|
|
|
|
@ -46,7 +45,7 @@
|
|
|
|
|
(defn-spec replace-all-matching-values-by-new-value cp/map-or-seq?
|
|
|
|
|
[coll cp/map-or-seq?
|
|
|
|
|
value-to-match string?
|
|
|
|
|
value-to-replace string?]
|
|
|
|
|
value-to-replace cp/str-or-number?]
|
|
|
|
|
(clojure.walk/postwalk #(if (and (= (type value-to-match) (type %))
|
|
|
|
|
(= value-to-match %))
|
|
|
|
|
value-to-replace
|
|
|
|
@ -58,7 +57,10 @@
|
|
|
|
|
(into []
|
|
|
|
|
(apply concat vs)))
|
|
|
|
|
|
|
|
|
|
(defn generate-common [my-config my-auth config-defaults k8s-objects]
|
|
|
|
|
(defn generate-common
|
|
|
|
|
[my-config
|
|
|
|
|
my-auth
|
|
|
|
|
config-defaults k8s-objects]
|
|
|
|
|
(let [resulting-config (merge config-defaults my-config)]
|
|
|
|
|
(cs/join
|
|
|
|
|
"\n---\n"
|
|
|
|
|