diff --git a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc index bdaba1d..7841dea 100644 --- a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc +++ b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc @@ -122,9 +122,12 @@ (let [{:keys [namespace]} config] [(load-and-adjust-namespace "jitsi/restart-config-serviceaccount.yaml" namespace) (load-and-adjust-namespace "jitsi/restart-config-rolebinding.yaml" namespace) - (-> + (-> (load-and-adjust-namespace "jitsi/restart-config-authorization.yaml" namespace) - (cm/replace-key-value :resourceNames ["etherpad", "excalidraw"]))])) + (cm/replace-key-value :resourceNames ["etherpad", "excalidraw"])) + (-> + (load-and-adjust-namespace "jitsi/restart-config-cron.yaml" namespace) + (cm/replace-key-value :resourceNames))])) (defn-spec etherpad-config cp/map-or-seq? [config config?] diff --git a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc index 071e4bc..252fef0 100644 --- a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc +++ b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc @@ -138,7 +138,30 @@ {:fqdn "xy.xy.xy" :namespace "jitsi"}) 2))) - (is (= 3 + (is (= {:apiVersion "batch/v1", + :kind "CronJob", + :metadata {:name "deployment-restart", :namespace "jitsi"}, + :spec + {:concurrencyPolicy "Forbid", + :schedule "SCHEDULE_REPLACE_Me", + :jobTemplate + {:spec + {:backoffLimit 2, + :activeDeadlineSeconds 600, + :template + {:spec + {:serviceAccountName "deployment-restart", + :restartPolicy "Never", + :containers [{:name "kubectl", :image "bitnami/kubectl"}], + :command + ["bash" + "-c" + "kubectl rollout restart deployment/<YOUR DEPLOYMENT NAME> && kubectl rollout status deployment/<YOUR DEPLOYMENT NAME>"]}}}}}} + (nth (cut/restart-config + {:fqdn "xy.xy.xy" + :namespace "jitsi"}) + 3))) + (is (= 4 (count (cut/restart-config {:fqdn "xy.xy.xy" :namespace "jitsi"})))))