diff --git a/src/main/cljc/dda/c4k_keycloak/core.cljc b/src/main/cljc/dda/c4k_keycloak/core.cljc index 06c7566..ce6cc8f 100644 --- a/src/main/cljc/dda/c4k_keycloak/core.cljc +++ b/src/main/cljc/dda/c4k_keycloak/core.cljc @@ -14,19 +14,16 @@ (def config-defaults {:issuer "staging"}) -(s/def ::mon-cfg mon/config?) -(s/def ::mon-auth mon/auth?) - -(def config? (s/keys :req-un [::kc/fqdn] - :opt-un [::kc/issuer - ::mon-cfg])) +(s/def ::config (s/keys :req-un [::kc/fqdn] + :opt-un [::kc/issuer + ::mon/config])) (def auth? (s/keys :req-un [::kc/keycloak-admin-user ::kc/keycloak-admin-password ::postgres/postgres-db-user ::postgres/postgres-db-password] - :opt-un [::mon-auth])) + :opt-un [::mon/auth])) (defn-spec k8s-objects cp/map-or-seq? - [config config? + [config ::config auth auth?] (map yaml/to-string (filter diff --git a/src/test/cljc/dda/c4k_keycloak/core_test.cljc b/src/test/cljc/dda/c4k_keycloak/core_test.cljc index 9110e5f..fdc25c6 100644 --- a/src/test/cljc/dda/c4k_keycloak/core_test.cljc +++ b/src/test/cljc/dda/c4k_keycloak/core_test.cljc @@ -16,5 +16,5 @@ ;; TODO: 2023.01.27 - jem: may not validate k3s-cluster-name entries ... find out what's wrong. (deftest validate-valid-resources - (is (s/valid? cut/config? (yaml/load-as-edn "keycloak-test/valid-config.yaml"))) + (is (s/valid? ::cut/config (yaml/load-as-edn "keycloak-test/valid-config.yaml"))) (is (s/valid? cut/auth? (yaml/load-as-edn "keycloak-test/valid-auth.yaml")))) \ No newline at end of file diff --git a/src/test/resources/keycloak-test/valid-config.yaml b/src/test/resources/keycloak-test/valid-config.yaml index 4aa1c76..d995606 100644 --- a/src/test/resources/keycloak-test/valid-config.yaml +++ b/src/test/resources/keycloak-test/valid-config.yaml @@ -3,4 +3,4 @@ issuer: "staging" mon-cfg: grafana-cloud-url: "url-for-your-prom-remote-write-endpoint" cluster-name: "keycloak" - cluster-stage: "test" \ No newline at end of file + cluster-stage: :test \ No newline at end of file