add missing db-name
This commit is contained in:
parent
60baab6a8c
commit
d66189bd9f
6 changed files with 18 additions and 5 deletions
|
@ -31,9 +31,12 @@
|
|||
(throw (js/Error. "Undefined Resource!")))))
|
||||
|
||||
(defn generate-config [& args]
|
||||
(let [{:keys [postgres-size]
|
||||
:or {postgres-size :2gb}} args]
|
||||
(yaml/from-string (yaml/load-resource (str "postgres/config-" (name postgres-size) ".yaml")))))
|
||||
(let [{:keys [postgres-size db-name]
|
||||
:or {postgres-size :2gb
|
||||
db-name "postgres"}} args]
|
||||
(->
|
||||
(yaml/from-string (yaml/load-resource (str "postgres/config-" (name postgres-size) ".yaml")))
|
||||
(assoc-in [:data :postgres-db] db-name))))
|
||||
|
||||
(defn generate-deployment []
|
||||
(yaml/from-string (yaml/load-resource "postgres/deployment.yaml")))
|
||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
|||
labels:
|
||||
app: postgres
|
||||
data:
|
||||
postgres-db: postgres
|
||||
postgresql.conf: |
|
||||
max_connections = 1000
|
||||
work_mem = 4MB
|
||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
|||
labels:
|
||||
app: postgres
|
||||
data:
|
||||
postgres-db: postgres
|
||||
postgresql.conf: |
|
||||
max_connections = 100
|
||||
work_mem = 4MB
|
||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
|||
labels:
|
||||
app: postgres
|
||||
data:
|
||||
postgres-db: postgres
|
||||
postgresql.conf: |
|
||||
max_connections = 500
|
||||
work_mem = 2MB
|
||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
|||
labels:
|
||||
app: postgres
|
||||
data:
|
||||
postgres-db: postgres
|
||||
postgresql.conf: |
|
||||
max_connections = 700
|
||||
work_mem = 3MB
|
||||
|
|
|
@ -5,12 +5,18 @@
|
|||
[dda.c4k-common.postgres :as cut]))
|
||||
|
||||
(deftest should-generate-config
|
||||
(is (= {:postgresql.conf
|
||||
(is (= {:postgres-db "postgres"
|
||||
:postgresql.conf
|
||||
"max_connections = 100\nwork_mem = 4MB\nshared_buffers = 512MB\n"}
|
||||
(:data (cut/generate-config))))
|
||||
(is (= {:postgresql.conf
|
||||
(is (= {:postgres-db "postgres"
|
||||
:postgresql.conf
|
||||
"max_connections = 700\nwork_mem = 3MB\nshared_buffers = 2048MB\n"}
|
||||
(:data (cut/generate-config :postgres-size :8gb))))
|
||||
(is (= {:postgres-db "test"
|
||||
:postgresql.conf
|
||||
"max_connections = 100\nwork_mem = 4MB\nshared_buffers = 512MB\n"}
|
||||
(:data (cut/generate-config :db-name "test"))))
|
||||
)
|
||||
|
||||
(deftest should-generate-persistent-volume
|
||||
|
|
Loading…
Reference in a new issue