proper-namespace-implementation #2
2 changed files with 16 additions and 7 deletions
|
@ -39,8 +39,8 @@
|
|||
(cm/concat-vec
|
||||
(ns/generate config)
|
||||
(postgres/generate config auth)
|
||||
[(kc/generate-secret auth)
|
||||
(kc/generate-service)
|
||||
[(kc/generate-secret config auth)
|
||||
(kc/generate-service config)
|
||||
(kc/generate-deployment config)]
|
||||
(kc/generate-ingress config)
|
||||
(when (:contains? config :mon-cfg)
|
||||
|
|
|
@ -37,20 +37,29 @@
|
|||
config)))
|
||||
|
||||
(defn-spec generate-secret cp/map-or-seq?
|
||||
[auth auth?]
|
||||
(let [{:keys [keycloak-admin-user keycloak-admin-password]} auth]
|
||||
[config config?
|
||||
auth auth?]
|
||||
(let [{:keys [namespace]} config
|
||||
{:keys [keycloak-admin-user keycloak-admin-password]} auth]
|
||||
(->
|
||||
(yaml/load-as-edn "keycloak/secret.yaml")
|
||||
(cm/replace-all-matching "NAMESPACE" namespace)
|
||||
(cm/replace-key-value :keycloak-user (b64/encode keycloak-admin-user))
|
||||
(cm/replace-key-value :keycloak-password (b64/encode keycloak-admin-password)))))
|
||||
|
||||
(defn-spec generate-service cp/map-or-seq? []
|
||||
(yaml/load-as-edn "keycloak/service.yaml"))
|
||||
(defn-spec generate-service cp/map-or-seq?
|
||||
[config config?]
|
||||
(let [{:keys [namespace]} config
|
||||
{:keys [keycloak-admin-user keycloak-admin-password]} auth]
|
||||
(->
|
||||
(yaml/load-as-edn "keycloak/service.yaml")
|
||||
(cm/replace-all-matching "NAMESPACE" namespace))))
|
||||
|
||||
(defn-spec generate-deployment cp/map-or-seq?
|
||||
[config config?]
|
||||
(let [{:keys [fqdn]} config]
|
||||
(let [{:keys [fqdn namespace]} config]
|
||||
(->
|
||||
(yaml/load-as-edn "keycloak/deployment.yaml")
|
||||
(cm/replace-all-matching "NAMESPACE" namespace)
|
||||
(cm/replace-all-matching-values-by-new-value "FQDN" fqdn))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue