You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case CockroachDB is used as backend and KIND_ENDPOINT points at a non-existing database, the PostgreSQL driver does not create the corresponding database.
Steps to reproduce:
Point KINE_ENDPOINT at non-existing database in file test-run-cockroachdb (e.g. KINE_ENDPOINT="postgres://root@$ip:$port/kine?sslmode=disable$extra_params")
Run tests with scripts/test
kine fails with:
[cockroachdb-v20.2] time="2022-11-29T12:51:42Z" level=info msg="starting metrics server path /metrics"
[cockroachdb-v20.2] time="2022-11-29T12:51:42Z" level=info msg="Configuring postgres database connection pooling: maxIdleConns=2, maxOpenConns=0, connMaxLifetime=0s"
[cockroachdb-v20.2] time="2022-11-29T12:51:42Z" level=info msg="Configuring database table schema and indexes, this may take a moment..."
[cockroachdb-v20.2] time="2022-11-29T12:51:42Z" level=trace msg="SETUP EXEC : CREATE TABLE IF NOT EXISTS kine ( id SERIAL PRIMARY KEY, name VARCHAR(630), created INTEGER, deleted INTEGER, create_revision INTEGER, prev_revision INTEGER, lease INTEGER, value bytea, old_value bytea );"
[cockroachdb-v20.2] time="2022-11-29T12:51:42Z" level=fatal msg="building kine: pq: no database or schema specified"
Reason:
It seems that (at least in my local setup), the following code is causing this behavior:
Hmm, so CockroachDB allows pinging a nonexistent DB. That seems like a problem, but I'm not quite sure how to handle it since we're just using the generic postgres driver, which cockroachdb claims to be compliant with.
In case CockroachDB is used as backend and
KIND_ENDPOINT
points at a non-existing database, the PostgreSQL driver does not create the corresponding database.Steps to reproduce:
KINE_ENDPOINT
at non-existing database in file test-run-cockroachdb (e.g.KINE_ENDPOINT="postgres://root@$ip:$port/kine?sslmode=disable$extra_params"
)scripts/test
Reason:
It seems that (at least in my local setup), the following code is causing this behavior:
kine/pkg/drivers/pgsql/pgsql.go
Lines 133 to 137 in aade545
db.Ping()
in this case returnsnil
instead of an error and therefore the following type assertion fails andnil
is returned to the caller.The text was updated successfully, but these errors were encountered: