Fix incorrect incompatibility warning in tsh #49455
Merged
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.
Closes #49441
When adding a warning about connecting to a too old cluster from tsh, I mistakenly compared the entire version strings instead of major versions only. This caused the warning to be shown even when the client is on a newer patch version which is compatible.
I decided to extract
getClientIncompatibilityWarning()
out ofPing()
for easier testing. The problem was the server version is compared againstteleport.Version
constant which I can't overwrite in tests.Additionally, I removed a check requiring at least a v15 cluster. tsh v17 is not compatible with clusters < 17.0.0.
Changelog: Fixed an incorrect warning indicating that tsh v17.0.2 was incompatible with cluster v17.0.1, despite full compatibility