gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.69k stars 1.77k forks source link

Fix incorrect incompatibility warning in tsh #49455

Closed gzdunek closed 3 days ago

gzdunek commented 3 days ago

Closes https://github.com/gravitational/teleport/issues/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 of Ping() for easier testing. The problem was the server version is compared against teleport.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

public-teleport-github-review-bot[bot] commented 3 days ago

@gzdunek See the table below for backport results.

Branch Result
branch/v17 Create PR