Split merged config

This commit is contained in:
bom 2023-01-20 15:14:25 +01:00
parent f8348f704a
commit 0882afd5d1

View file

@ -18,16 +18,17 @@
(def auth? (s/keys :req-un [::kc/keycloak-admin-user ::kc/keycloak-admin-password])) (def auth? (s/keys :req-un [::kc/keycloak-admin-user ::kc/keycloak-admin-password]))
(defn-spec k8s-objects any? (defn-spec k8s-objects any?
[config (s/merge config? auth?)] [config config?
auth auth?]
(into (into
[] []
(concat [(yaml/to-string (postgres/generate-config {:postgres-size :2gb :db-name "keycloak"})) (concat [(yaml/to-string (postgres/generate-config {:postgres-size :2gb :db-name "keycloak"}))
(yaml/to-string (postgres/generate-secret config)) (yaml/to-string (postgres/generate-secret auth))
(yaml/to-string (postgres/generate-pvc {:pv-storage-size-gb 30 (yaml/to-string (postgres/generate-pvc {:pv-storage-size-gb 30
:pvc-storage-class-name default-storage-class})) :pvc-storage-class-name default-storage-class}))
(yaml/to-string (postgres/generate-deployment :postgres-image "postgres:14")) (yaml/to-string (postgres/generate-deployment :postgres-image "postgres:14"))
(yaml/to-string (postgres/generate-service)) (yaml/to-string (postgres/generate-service))
(yaml/to-string (kc/generate-secret (:auth config))) (yaml/to-string (kc/generate-secret auth))
(yaml/to-string (kc/generate-ingress config)) (yaml/to-string (kc/generate-ingress config))
(yaml/to-string (kc/generate-service)) (yaml/to-string (kc/generate-service))
(yaml/to-string (kc/generate-deployment))]))) (yaml/to-string (kc/generate-deployment))])))
@ -35,7 +36,6 @@
(defn-spec generate any? (defn-spec generate any?
[my-config config? [my-config config?
my-auth auth?] my-auth auth?]
(let [resulting-config (merge config-defaults my-config my-auth)]
(cs/join (cs/join
"\n---\n" "\n---\n"
(k8s-objects resulting-config)))) (k8s-objects my-config my-auth)))