Skip to content

Machine ID: Fix tshwrap destination dir handling#48186

Merged
timothyb89 merged 1 commit intomasterfrom
timothyb89/fix-tbot-tshwrap-destination-dir
Oct 31, 2024
Merged

Machine ID: Fix tshwrap destination dir handling#48186
timothyb89 merged 1 commit intomasterfrom
timothyb89/fix-tbot-tshwrap-destination-dir

Conversation

@timothyb89
Copy link
Copy Markdown
Contributor

Recent CLI handling changes broke destination dir resolution for commands that use tshwrap.GetDestinationDir() to resolve destinations from either the CLI or config file.

The old behavior depends on implicit creation of an identity service if --destination-dir was provided on the CLI and no config file is loaded. We now no longer make this assumption and prefer to only resolve explicit configurations, so this tweaks
tshwrap.GetDestinationDir() to explicitly handle the CLI parameter rather than hoping it appears in the generated config.

While this is legacy functionality, it's not slated for removal in v17. Most users should still prefer to use the new app and database tunnel services wherever possible.

Fixes #48107

Recent CLI handling changes broke destination dir resolution for
commands that use `tshwrap.GetDestinationDir()` to resolve
destinations from either the CLI or config file.

The old behavior depends on implicit creation of an identity service
if `--destination-dir` was provided on the CLI and no config file is
loaded. We now no longer make this assumption and prefer to only
resolve explicit configurations, so this tweaks
`tshwrap.GetDestinationDir()` to explicitly handle the CLI parameter
rather than hoping it appears in the generated config.

While this is legacy functionality, it's not slated for removal in
v17. Most users should still prefer to use the new app and database
tunnel services wherever possible.

Fixes #48107
@timothyb89 timothyb89 added test-plan A list of tasks required to ship a successful product release. no-changelog Indicates that a PR does not require a changelog entry backport/branch/v17 labels Oct 30, 2024
@timothyb89 timothyb89 requested a review from strideynet October 30, 2024 23:35
@github-actions github-actions Bot requested a review from Joerger October 30, 2024 23:35
@aws-amplify-us-west-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-48186.d3pp5qlev8mo18.amplifyapp.com

Comment thread lib/tbot/tshwrap/wrap.go
Comment on lines -143 to -148
// WARNING:
// This code is dependent on some unexpected "behavior" in
// config.FromCLIConf() - when users provide --destination-dir then all
// outputs configured in the YAML file are overwritten by an identity
// output with a directory destination with a path of --destination-dir.
// See: https://github.com/gravitational/teleport/issues/27206
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed this warning, I think #27206 was more or less resolved after this and #47130?

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from Joerger October 31, 2024 21:48
@timothyb89 timothyb89 added this pull request to the merge queue Oct 31, 2024
Merged via the queue into master with commit 225f285 Oct 31, 2024
@timothyb89 timothyb89 deleted the timothyb89/fix-tbot-tshwrap-destination-dir branch October 31, 2024 22:07
@public-teleport-github-review-bot
Copy link
Copy Markdown

@timothyb89 See the table below for backport results.

Branch Result
branch/v17 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/branch/v17 machine-id no-changelog Indicates that a PR does not require a changelog entry size/sm test-plan A list of tasks required to ship a successful product release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Machine ID: tbot proxy and tbot db connect should be able to load config from the CLI

3 participants