adjust to new issuer naming

This commit is contained in:
jerger 2022-03-19 19:15:06 +01:00
parent 4dbe5367a7
commit a224506caa
3 changed files with 6 additions and 6 deletions

View file

@ -10,7 +10,7 @@
[dda.c4k-common.common :as cm]
[dda.c4k-common.postgres :as postgres]))
(s/def ::fqdn any?) ; TODO: Fix fqdn-string? to include localhost
(s/def ::fqdn cp/fqdn-string?)
(s/def ::issuer cp/letsencrypt-issuer?)
(s/def ::restic-repository string?)
(s/def ::nextcloud-data-volume-path string?)
@ -38,7 +38,7 @@
(defn generate-certificate [config]
(let [{:keys [fqdn issuer]} config
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")]
letsencrypt-issuer (name issuer)]
(->
(yaml/from-string (yaml/load-resource "nextcloud/certificate.yaml"))
(assoc-in [:spec :commonName] fqdn)
@ -53,7 +53,7 @@
(defn generate-ingress [config]
(let [{:keys [fqdn issuer]
:or {issuer :staging}} config
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")]
letsencrypt-issuer (name issuer)]
(->
(yaml/from-string (yaml/load-resource "nextcloud/ingress.yaml"))
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)

View file

@ -9,5 +9,5 @@ spec:
dnsNames:
- fqdn
issuerRef:
name: letsencrypt-staging-issuer
name: staging
kind: ClusterIssuer

View file

@ -24,7 +24,7 @@
:commonName "xx"
:dnsNames ["xx"]
:issuerRef
{:name "letsencrypt-prod-issuer", :kind "ClusterIssuer"}}}
{:name "prod", :kind "ClusterIssuer"}}}
(cut/generate-certificate {:fqdn "xx" :issuer :prod}))))
(deftest should-generate-ingress
@ -33,7 +33,7 @@
:metadata
{:name "ingress-cloud"
:annotations
{:cert-manager.io/cluster-issuer "letsencrypt-staging-issuer"
{:cert-manager.io/cluster-issuer "staging"
:ingress.kubernetes.io/proxy-body-size "256m"
:ingress.kubernetes.io/ssl-redirect "true"
:ingress.kubernetes.io/rewrite-target "/"