Skip to content

Register database engines directly from db lib#19279

Merged
greedy52 merged 3 commits intomasterfrom
STeve/register_db_engine_directly_from_db_lib
Dec 18, 2022
Merged

Register database engines directly from db lib#19279
greedy52 merged 3 commits intomasterfrom
STeve/register_db_engine_directly_from_db_lib

Conversation

@greedy52
Copy link
Copy Markdown
Contributor

@greedy52 greedy52 commented Dec 12, 2022

This is a follow-up of

As suggested by #19239 (comment), srv/lib now explicitly register the database engines, instead of relying on importing the "engine" packages.

Also added a check to confirm engines are registered when creating a database service. This helps capture the problem in test and integration test

ERROR REPORT:
Original Error: *trace.NotFoundError database engine "sqlserver" is not registered
Stack Trace:
	/Users/stevehuang/go/github.com/gravitational/teleport/lib/srv/db/common/engines.go:73 github.com/gravitational/teleport/lib/srv/db/common.CheckEngines
	/Users/stevehuang/go/github.com/gravitational/teleport/lib/srv/db/server.go:305 github.com/gravitational/teleport/lib/srv/db.New
	/Users/stevehuang/go/github.com/gravitational/teleport/lib/service/db.go:134 github.com/gravitational/teleport/lib/service.(*TeleportProcess).initDatabaseService
	/Users/stevehuang/go/github.com/gravitational/teleport/lib/service/supervisor.go:539 github.com/gravitational/teleport/lib/service.(*LocalService).Serve
	/Users/stevehuang/go/github.com/gravitational/teleport/lib/service/supervisor.go:276 github.com/gravitational/teleport/lib/service.(*LocalSupervisor).serve.func1

@greedy52 greedy52 self-assigned this Dec 12, 2022
@github-actions github-actions Bot added database-access Database access related issues and PRs size/sm labels Dec 12, 2022
Copy link
Copy Markdown
Contributor

@timothyb89 timothyb89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely nice to see init functions go away

@greedy52 greedy52 enabled auto-merge (squash) December 16, 2022 19:06
@greedy52 greedy52 merged commit 6c858c0 into master Dec 18, 2022
@greedy52 greedy52 deleted the STeve/register_db_engine_directly_from_db_lib branch December 18, 2022 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

database-access Database access related issues and PRs size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants