use load-and-adjust

This commit is contained in:
Michael Jerger 2025-03-10 16:54:51 +01:00
parent b398f6b56c
commit 4d808590a6
4 changed files with 5 additions and 7 deletions
build.pyproject.clj
src
main/cljc/dda/c4k_keycloak
test/cljc/dda/c4k_keycloak

View file

@ -160,7 +160,6 @@ def inst(project):
check=True,
)
package_native(project)
run(
"sudo install -m=755 target/graalvm/" + project.name + " /usr/local/bin/" + project.name + "",
shell=True,

View file

@ -5,7 +5,7 @@
:url "https://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.12.0"]
[org.clojure/tools.reader "1.5.1"]
[org.domaindrivenarchitecture/c4k-common-clj "9.0.1"]]
[org.domaindrivenarchitecture/c4k-common-clj "9.0.2-SNAPSHOT"]]
:target-path "target/%s/"
:source-paths ["src/main/cljc"
"src/main/clj"]

View file

@ -8,7 +8,8 @@
[dda.c4k-common.common :as cm]
[dda.c4k-common.base64 :as b64]
[dda.c4k-common.ingress :as ing]
[dda.c4k-common.predicate :as cp]))
[dda.c4k-common.predicate :as cp]
[dda.c4k-common.namespace :as ns]))
(s/def ::fqdn cp/fqdn-string?)
(s/def ::issuer cp/letsencrypt-issuer?)
@ -35,9 +36,7 @@
(defn-spec generate-configmap cp/map-or-seq?
[config config?]
(let [{:keys [namespace]} config]
(->
(yaml/load-as-edn "keycloak/configmap.yaml")
(cm/replace-all-matching "NAMESPACE" namespace))))
(ns/load-and-adjust-namespace "keycloak/configmap.yaml" namespace)))
(defn-spec generate-service-headless cp/map-or-seq?
[config config?]

View file

@ -22,7 +22,7 @@
(is (not (s/valid? cut/auth? (yaml/load-as-edn "keycloak-test/invalid-auth.yaml")))))
(deftest test-whole-generation
(is (= 29
(is (= 32
(count
(cut/config-objects
(yaml/load-as-edn "keycloak-test/valid-config.yaml")))))