Skip to content

[teleport-update] Stabilize tsh paths when run from agent installation#60625

Merged
sclevine merged 2 commits intomasterfrom
sclevine/tsh-template-fix
Oct 31, 2025
Merged

[teleport-update] Stabilize tsh paths when run from agent installation#60625
sclevine merged 2 commits intomasterfrom
sclevine/tsh-template-fix

Conversation

@sclevine
Copy link
Copy Markdown
Member

When tsh is invoked from an Agent Managed Updates installation but is being used as a client tool, paths are not stabilized with autoupdate/agent.StableExecutable(). This is not an issue for most short-running re-executions of tsh in-memory, but it does break instances where tsh writes its path into a configuration file, such as in #60600.

This PR fixes the issue by using the path from autoupdate/agent.StableExecutable() instead of os.Executable(). This function should always be safe to swap in, as it ensures tsh is being invoked from an unstable path before returning different values.

This PR is similar to #54145, which addresses the same issue for tbot (which is updated via Agent Managed Updates).

changelog: stabilize tsh paths when run from agent installation

RFD: #47126
Goal (internal): https://github.com/gravitational/cloud/issues/14225

Fixes #60600

@github-actions github-actions bot added size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Oct 27, 2025
@sclevine sclevine requested review from rosstimothy and removed request for strideynet October 27, 2025 16:43
@sclevine
Copy link
Copy Markdown
Member Author

(Swapping Noah -> Tim as reviewer since Noah is OOO and Tim was suggested for this file.)

@sclevine sclevine requested a review from hugoShaka October 27, 2025 23:47
@sclevine
Copy link
Copy Markdown
Member Author

@rosstimothy @hugoShaka this is customer impacting, please let me know if I should look for other G1 reviewers

@sclevine sclevine added this pull request to the merge queue Oct 31, 2025
Merged via the queue into master with commit 805bbc5 Oct 31, 2025
41 checks passed
@sclevine sclevine deleted the sclevine/tsh-template-fix branch October 31, 2025 14:46
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@sclevine See the table below for backport results.

Branch Result
branch/v16 Create PR
branch/v17 Create PR
branch/v18 Create PR

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

Labels

backport/branch/v17 backport/branch/v18 size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When creating a .kube/config, the path of TSH is hard coded to a location that changes

3 participants