Skip to content
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

Allow tsh ssh to use predicate expressions/search keywords from proxy templates #43983

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

rosstimothy
Copy link
Contributor

@rosstimothy rosstimothy commented Jul 9, 2024

While tsh ssh doesn't explicitly allow specifying predicate expressions or search keywords via the CLI they can be populated via a proxy template. However, the node resolution code in tsh only considered labels which results in confusing behavior, especially given the fact that debug logs indicate that a proxy template match was found and being used.

Changelog: Honor proxy templates in tsh ssh

… templates

While tsh ssh doesn't explicitly allow specifying predicate expressions
or search keywords via the CLI they can be populated via a proxy template.
However, the node resolution code in tsh only considered labels which
results in confusing behavior, especially given the fact that debug logs
indicate that a proxy template match was found and being used.
if err == nil {
return nil, trace.BadParameter("please use ssh subcommand with '--port=%v' flag instead of semicolon", port)
// Query for nodes if labels, fuzzy search, or predicate expressions were provided.
if len(tc.Labels) > 0 || len(tc.SearchKeywords) > 0 || tc.PredicateExpression != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there some more intrinsic way to write this check? or do we just kinda have to know that this is all and only what the ListResourcesRequest cares about for now, and any change will require manual updates in other places?

@rosstimothy rosstimothy added this pull request to the merge queue Jul 10, 2024
Merged via the queue into master with commit 5bcaf28 Jul 10, 2024
45 checks passed
@rosstimothy rosstimothy deleted the tross/tsh_templates branch July 10, 2024 18:24
@public-teleport-github-review-bot

@rosstimothy See the table below for backport results.

Branch Result
branch/v14 Failed
branch/v15 Create PR
branch/v16 Create PR

rosstimothy added a commit that referenced this pull request Jul 10, 2024
… templates (#43983)

While tsh ssh doesn't explicitly allow specifying predicate expressions
or search keywords via the CLI they can be populated via a proxy template.
However, the node resolution code in tsh only considered labels which
results in confusing behavior, especially given the fact that debug logs
indicate that a proxy template match was found and being used.
github-merge-queue bot pushed a commit that referenced this pull request Jul 10, 2024
… templates (#43983) (#44031)

While tsh ssh doesn't explicitly allow specifying predicate expressions
or search keywords via the CLI they can be populated via a proxy template.
However, the node resolution code in tsh only considered labels which
results in confusing behavior, especially given the fact that debug logs
indicate that a proxy template match was found and being used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants