use full canonical name for cockroach host
This commit is contained in:
parent
60b600d4b5
commit
3434c3100e
1 changed files with 1 additions and 1 deletions
2
db/db.go
2
db/db.go
|
@ -33,7 +33,7 @@ func Connect() error {
|
||||||
|
|
||||||
dsn := fmt.Sprintf("postgresql://%s@localhost:26257/cycore?sslmode=disabled", username)
|
dsn := fmt.Sprintf("postgresql://%s@localhost:26257/cycore?sslmode=disabled", username)
|
||||||
if os.Getenv("KUBERNETES_SERVICE_HOST") != "" {
|
if os.Getenv("KUBERNETES_SERVICE_HOST") != "" {
|
||||||
dsn = fmt.Sprintf("postgresql://%s:%s@cockroachdb-public.db:26257/cycore?sslmode=verify-full&sslrootcert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt&sslcert=/cockroach-certs/cert&sslkey=/cockroach-certs/key", username, password)
|
dsn = fmt.Sprintf("postgresql://%s:%s@cockroachdb-public.db.svc.cluster.local:26257/cycore?sslmode=verify-full&sslrootcert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt&sslcert=/cockroach-certs/cert&sslkey=/cockroach-certs/key", username, password)
|
||||||
}
|
}
|
||||||
if os.Getenv("DSN") != "" {
|
if os.Getenv("DSN") != "" {
|
||||||
dsn = os.Getenv("DSN")
|
dsn = os.Getenv("DSN")
|
||||||
|
|
Loading…
Reference in a new issue