Fix tests

This commit is contained in:
bom 2023-03-02 11:44:42 +01:00
parent 861f1f1c21
commit 11323e2832

View file

@ -43,9 +43,12 @@
(deftest should-generate-ingress-and-cert (deftest should-generate-ingress-and-cert
(is (= [{:apiVersion "cert-manager.io/v1", (is (= [{:apiVersion "cert-manager.io/v1",
:kind "Certificate", :kind "Certificate",
:metadata {:name "nextcloud", :labels {:app.kubernetes.part-of "nextcloud"}, :namespace "default"}, :metadata
{:name "cloud-service",
:labels {:app.kubernetes.part-of "cloud-service"},
:namespace "default"},
:spec :spec
{:secretName "nextcloud", {:secretName "cloud-service",
:commonName "somefqdn.de", :commonName "somefqdn.de",
:duration "2160h", :duration "2160h",
:renewBefore "360h", :renewBefore "360h",
@ -54,18 +57,24 @@
{:apiVersion "networking.k8s.io/v1", {:apiVersion "networking.k8s.io/v1",
:kind "Ingress", :kind "Ingress",
:metadata :metadata
{:name "nextcloud", {:name "cloud-service",
:namespace "default", :namespace "default",
:labels {:app.kubernetes.part-of "nextcloud"}, :labels {:app.kubernetes.part-of "cloud-service"},
:annotations :annotations
{:traefik.ingress.kubernetes.io/router.entrypoints "web, websecure", {:traefik.ingress.kubernetes.io/router.entrypoints "web, websecure",
:traefik.ingress.kubernetes.io/router.middlewares "default-redirect-https@kubernetescrd", :traefik.ingress.kubernetes.io/router.middlewares
"default-redirect-https@kubernetescrd",
:metallb.universe.tf/address-pool "public"}}, :metallb.universe.tf/address-pool "public"}},
:spec :spec
{:tls [{:hosts ["somefqdn.de"], :secretName "nextcloud"}], {:tls [{:hosts ["somefqdn.de"], :secretName "cloud-service"}],
:rules :rules
[{:host "somefqdn.de", [{:host "somefqdn.de",
:http {:paths [{:pathType "Prefix", :path "/", :backend {:service {:name "nextcloud", :port {:number 80}}}}]}}]}}] :http
{:paths
[{:pathType "Prefix",
:path "/",
:backend
{:service {:name "cloud-service", :port {:number 80}}}}]}}]}}]
(cut/generate-ingress-and-cert {:fqdn "somefqdn.de"})))) (cut/generate-ingress-and-cert {:fqdn "somefqdn.de"}))))
(deftest should-generate-pvc (deftest should-generate-pvc
@ -89,7 +98,7 @@
{:metadata {:labels {:app "cloud-app", :app.kubernetes.io/name "cloud-pod", :app.kubernetes.io/application "cloud", :redeploy "v3"}} {:metadata {:labels {:app "cloud-app", :app.kubernetes.io/name "cloud-pod", :app.kubernetes.io/application "cloud", :redeploy "v3"}}
:spec :spec
{:containers {:containers
[{:image "domaindrivenarchitecture/c4k-cloud" [{:image "domaindrivenarchitecture/c4k-cloud:7.0.0"
:name "cloud-app" :name "cloud-app"
:imagePullPolicy "IfNotPresent" :imagePullPolicy "IfNotPresent"
:ports [{:containerPort 80}] :ports [{:containerPort 80}]