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!")))))
|
(throw (js/Error. "Undefined Resource!")))))
|
||||||
|
|
||||||
(defn generate-config [& args]
|
(defn generate-config [& args]
|
||||||
(let [{:keys [postgres-size]
|
(let [{:keys [postgres-size db-name]
|
||||||
:or {postgres-size :2gb}} args]
|
:or {postgres-size :2gb
|
||||||
(yaml/from-string (yaml/load-resource (str "postgres/config-" (name postgres-size) ".yaml")))))
|
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 []
|
(defn generate-deployment []
|
||||||
(yaml/from-string (yaml/load-resource "postgres/deployment.yaml")))
|
(yaml/from-string (yaml/load-resource "postgres/deployment.yaml")))
|
||||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: postgres
|
app: postgres
|
||||||
data:
|
data:
|
||||||
|
postgres-db: postgres
|
||||||
postgresql.conf: |
|
postgresql.conf: |
|
||||||
max_connections = 1000
|
max_connections = 1000
|
||||||
work_mem = 4MB
|
work_mem = 4MB
|
||||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: postgres
|
app: postgres
|
||||||
data:
|
data:
|
||||||
|
postgres-db: postgres
|
||||||
postgresql.conf: |
|
postgresql.conf: |
|
||||||
max_connections = 100
|
max_connections = 100
|
||||||
work_mem = 4MB
|
work_mem = 4MB
|
||||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: postgres
|
app: postgres
|
||||||
data:
|
data:
|
||||||
|
postgres-db: postgres
|
||||||
postgresql.conf: |
|
postgresql.conf: |
|
||||||
max_connections = 500
|
max_connections = 500
|
||||||
work_mem = 2MB
|
work_mem = 2MB
|
||||||
|
|
|
@ -5,6 +5,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: postgres
|
app: postgres
|
||||||
data:
|
data:
|
||||||
|
postgres-db: postgres
|
||||||
postgresql.conf: |
|
postgresql.conf: |
|
||||||
max_connections = 700
|
max_connections = 700
|
||||||
work_mem = 3MB
|
work_mem = 3MB
|
||||||
|
|
|
@ -5,12 +5,18 @@
|
||||||
[dda.c4k-common.postgres :as cut]))
|
[dda.c4k-common.postgres :as cut]))
|
||||||
|
|
||||||
(deftest should-generate-config
|
(deftest should-generate-config
|
||||||
(is (= {:postgresql.conf
|
(is (= {:postgres-db "postgres"
|
||||||
|
:postgresql.conf
|
||||||
"max_connections = 100\nwork_mem = 4MB\nshared_buffers = 512MB\n"}
|
"max_connections = 100\nwork_mem = 4MB\nshared_buffers = 512MB\n"}
|
||||||
(:data (cut/generate-config))))
|
(:data (cut/generate-config))))
|
||||||
(is (= {:postgresql.conf
|
(is (= {:postgres-db "postgres"
|
||||||
|
:postgresql.conf
|
||||||
"max_connections = 700\nwork_mem = 3MB\nshared_buffers = 2048MB\n"}
|
"max_connections = 700\nwork_mem = 3MB\nshared_buffers = 2048MB\n"}
|
||||||
(:data (cut/generate-config :postgres-size :8gb))))
|
(: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
|
(deftest should-generate-persistent-volume
|
||||||
|
|
Loading…
Reference in a new issue