Skip to content

[v16] Reorganize tctl commands to not require an auth client by default#50968

Merged
vapopov merged 2 commits intobranch/v16from
vapopov/auth-client-lazy-loading-v16
Jan 23, 2025
Merged

[v16] Reorganize tctl commands to not require an auth client by default#50968
vapopov merged 2 commits intobranch/v16from
vapopov/auth-client-lazy-loading-v16

Conversation

@vapopov
Copy link
Copy Markdown
Contributor

@vapopov vapopov commented Jan 11, 2025

Backport #48894 to branch/v16

…8894)

* Reorganize tctl commands to have commands not required auth client

* Replace auth client with lazy loading approach

* Fix linter warning

* Replace camel case in import alias
Replace logrus to use slog

* Rename close function

* Refactor plugin commands to use interface of auth client and plugin client
Code review changes

* Refactor workload identity commands

* Add access to global config for the commands

* Add test checking all tctl commands match process

* Fix golangci-lint warnings
@vapopov vapopov added backport no-changelog Indicates that a PR does not require a changelog entry labels Jan 11, 2025
@github-actions github-actions Bot added size/md tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Jan 11, 2025
@vapopov vapopov added this pull request to the merge queue Jan 23, 2025
Merged via the queue into branch/v16 with commit 9a965d0 Jan 23, 2025
@vapopov vapopov deleted the vapopov/auth-client-lazy-loading-v16 branch January 23, 2025 19:23
Comment thread tool/tctl/common/tctl.go
// TryRun is executed after the CLI parsing is done. The command must
// determine if selectedCommand belongs to it and return match=true
TryRun(ctx context.Context, selectedCommand string, c *authclient.Client) (match bool, err error)
TryRun(ctx context.Context, cmd string, clientFunc commonclient.InitFunc) (match bool, err error)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This broke e/ due to the signature change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should have updated teleport.e reference after merging https://github.com/gravitational/teleport.e/pull/5851

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

Labels

backport no-changelog Indicates that a PR does not require a changelog entry size/md tctl tctl - Teleport admin tool 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.

4 participants