Implement specs as defs and not functions

This caused values to be spec valid no matter what
This commit is contained in:
bom 2023-01-27 10:25:59 +01:00
parent e1b1adfe20
commit 67c2fb4af7

View file

@ -19,19 +19,15 @@
(s/def ::traefik-regex string?) (s/def ::traefik-regex string?)
(s/def ::kube-state-regex string?) (s/def ::kube-state-regex string?)
(defn config? [input] (def config? (s/keys :req-un [::grafana-cloud-url
(s/keys :req-un [::grafana-cloud-url
::cluster-name ::cluster-name
::cluster-stage])) ::cluster-stage]))
(defn auth? [input] (def auth? (s/keys :req-un [::grafana-cloud-user ::grafana-cloud-password]))
(s/keys :req-un [::grafana-cloud-user ::grafana-cloud-password]))
(defn storage? [input] (def storage? (s/keys :opt-un [::pvc-storage-class-name]))
(s/keys :opt-un [::pvc-storage-class-name]))
(defn filter-regex? [input] (def filter-regex? (s/keys :req-un [::node-regex ::traefik-regex ::kube-state-regex]))
(s/keys :req-un [::node-regex ::traefik-regex ::kube-state-regex]))
(def metric-regex {:node-regex (def metric-regex {:node-regex
(str "node_cpu_sec.+|node_load[0-9]+|node_memory_Buf.*|node_memory_Mem.*|" (str "node_cpu_sec.+|node_load[0-9]+|node_memory_Buf.*|node_memory_Mem.*|"