Skip to content

Fix MySQL and Postgres service file path bug#29220

Merged
GavinFrazar merged 1 commit intomasterfrom
gavinfrazar/mock-pg-and-mysql-conf-filepath-properly
Jul 20, 2023
Merged

Fix MySQL and Postgres service file path bug#29220
GavinFrazar merged 1 commit intomasterfrom
gavinfrazar/mock-pg-and-mysql-conf-filepath-properly

Conversation

@GavinFrazar
Copy link
Copy Markdown
Contributor

This PR fixes a bug introduced in unreleased master changes.

In #28505 I needed to speed up tsh db tests substantially to pass the flaky test detector timeout.

A problem I ran into was that parallel tests involving tsh db login/logout with postgres/mysql databases were racing because tsh updates the same config file for each in the user's home dir, so sometimes the tests would fail as they clobbered eachother's pg/mysql config file.

So, I mocked postgres and mysql config file path locations by reusing TeleportClient.HomePath.

However, I realized today that this introduced a bug with tsh db login - when a user sets TELEPORT_HOME env var, HomePath will be set to match that, so tsh db login will save/load/update those mysql/postgres config files in ~/.tsh (or wherever TELEPORT_HOME points to), rather than the user's home dir (the prior behavior).

I'll merge these changes into the v13 backport as well before I merge that: #29163

@GavinFrazar GavinFrazar added bug tsh tsh - Teleport's command line tool for logging into nodes running Teleport. database-access Database access related issues and PRs db/postgres PostgreSQL related database access issues db/mysql MySQL related database access issues labels Jul 17, 2023
@github-actions github-actions Bot requested review from camscale and nklaassen July 17, 2023 20:45
Comment thread lib/client/db/profile.go Outdated
Comment thread lib/client/api.go Outdated
@smallinsky smallinsky self-requested a review July 19, 2023 15:35
Comment thread lib/client/db/dbcmd/dbcmd.go Outdated
Comment thread tool/tsh/common/tsh.go Outdated
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from camscale July 20, 2023 10:21
* add test-specific override flags instead of reusing .tsh
  dir override.
@GavinFrazar GavinFrazar force-pushed the gavinfrazar/mock-pg-and-mysql-conf-filepath-properly branch from 2b2f3cb to 2e55b44 Compare July 20, 2023 18:02
@GavinFrazar GavinFrazar enabled auto-merge July 20, 2023 18:02
@GavinFrazar GavinFrazar added this pull request to the merge queue Jul 20, 2023
Merged via the queue into master with commit e620afa Jul 20, 2023
@GavinFrazar GavinFrazar deleted the gavinfrazar/mock-pg-and-mysql-conf-filepath-properly branch July 20, 2023 18:38
@GavinFrazar
Copy link
Copy Markdown
Contributor Author

Backport included in #29163

GavinFrazar added a commit that referenced this pull request Jul 20, 2023
github-merge-queue Bot pushed a commit that referenced this pull request Jul 25, 2023
* [v13] update tsh db resource selection

Backport #28505 to branch/v13

* [v13] Fix MySQL and Postgres opt file path override

Backports #29220 to branch/v13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug database-access Database access related issues and PRs db/mysql MySQL related database access issues db/postgres PostgreSQL related database access issues size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants