Moved letsencrypt-issuer? back to c4k-common

merge-requests/4/head
Clemens Geibel 2 years ago
parent 5b4e68ae2a
commit 9f94116777

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

@ -10,14 +10,8 @@
[dda.c4k-common.common :as cm]
[dda.c4k-common.postgres :as postgres]))
; TODO: Replace method in c4k-common.predicate and update all c4k modules.
(defn letsencrypt-issuer?
[input]
(contains? #{"prod" "staging"} input))
; TODO: Remove (name ...) function calls, when issuer is no longer a keyword (also in c4k-common)
(s/def ::fqdn cp/fqdn-string?)
(s/def ::issuer letsencrypt-issuer?) ;cp/letsencrypt-issuer?
(s/def ::issuer cp/letsencrypt-issuer?)
(s/def ::restic-repository string?)
(s/def ::nextcloud-data-volume-path string?)
(s/def ::nextcloud-admin-user cp/bash-env-string?)
@ -44,7 +38,7 @@
(defn generate-certificate [config]
(let [{:keys [fqdn issuer]} config
letsencrypt-issuer (name issuer)]
letsencrypt-issuer issuer]
(->
(yaml/from-string (yaml/load-resource "nextcloud/certificate.yaml"))
(assoc-in [:spec :commonName] fqdn)
@ -59,7 +53,7 @@
(defn generate-ingress [config]
(let [{:keys [fqdn issuer]
:or {issuer "staging"}} config
letsencrypt-issuer (name issuer)]
letsencrypt-issuer issuer]
(->
(yaml/from-string (yaml/load-resource "nextcloud/ingress.yaml"))
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)

Loading…
Cancel
Save