-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix tsh config test #11603
Merged
Merged
fix tsh config test #11603
Conversation
This file contains 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
github-actions
bot
added
the
tsh
tsh - Teleport's command line tool for logging into nodes running Teleport.
label
Mar 31, 2022
greedy52
approved these changes
Mar 31, 2022
r0mant
approved these changes
Mar 31, 2022
zmb3
approved these changes
Mar 31, 2022
marcoandredinis
force-pushed
the
marco/fix_tshconfig_test
branch
from
April 1, 2022 08:14
ef479fb
to
56672f0
Compare
marcoandredinis
added a commit
that referenced
this pull request
Apr 1, 2022
check for error when writing to a file
marcoandredinis
added a commit
that referenced
this pull request
Apr 4, 2022
check for error when writing to a file
marcoandredinis
added a commit
that referenced
this pull request
Apr 5, 2022
check for error when writing to a file
marcoandredinis
added a commit
that referenced
this pull request
Apr 5, 2022
* tsh: ignore empty or non-existing config files (#11495) If the newly created config.yaml didnt exist we would load the default values and continue the flow However, we were not resetting the `err`'s value and would have an ERROR message at the end and an invalid exit code Most of the commands would reset that variable to the output of the command's execution One of them was not: `tsh version` The version command has no return value, so the program would execute as expected until the last statement: `trace.Wrap(error)` which would re-use the `err` variable whose value is the result of the `loadConfig` method. We could either reset the `err`s value inside the `PrintVersion` switch case block or reset it right after we check for `IsNotFound`. We ended up picking the first option as it seems cleaner ``` # before $ make full > /dev/null; build/tsh version Teleport v10.0.0-dev git:v8.0.0-alpha.1-899-g335adf1f4 go1.18 ERROR: open /home/marco/.tsh/config/config.yaml: no such file or directory # after $ make full > /dev/null; build/tsh version Teleport v10.0.0-dev git:v8.0.0-alpha.1-899-g335adf1f4 go1.18 ``` * fix tsh config test (#11603) check for error when writing to a file
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.
The last PR on those tests had a bug
As discussed here:
#11571 (comment)