Machine ID: Fix tshwrap destination dir handling#48186
Merged
timothyb89 merged 1 commit intomasterfrom Oct 31, 2024
Merged
Conversation
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
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
timothyb89
commented
Oct 30, 2024
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 |
Contributor
Author
strideynet
approved these changes
Oct 31, 2024
vapopov
approved these changes
Oct 31, 2024
|
@timothyb89 See the table below for backport results.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-dirwas 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 tweakstshwrap.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