Commit Graph
4 Commits
Author SHA1 Message Date
Zac Bergquist 2ae9d770fc Refactor tctl's dependencies (#22693)
* Move configuration from lib/service to lib/service/servicecfg

The new servicecfg package will hold only configuration for services.
This will allow other packages (like tctl and tsh) to depend on
servicecfg without pulling in all of lib/service (which has a number
of platform-specific details).

This is the first step towards being able to build tctl for Windows.

* Move PAM and BPF config into servicecfg

This breaks a compile-time dependency on BPF/PAM for tctl.
2023-03-09 17:48:36 +00:00
Zac Bergquist 6a2ed69567 tctl edit: get the original resource name from the file (#20362)
This ensures we correctly detect attempts to rename even when
aliases are used for dynamic resources like `cap`.
2023-01-22 14:45:00 +00:00
Zac Bergquist f8b4af2d59 tctl edit: fetch resource with secrets (#20334)
Ensure that tctl edit does the equivalent of
    tctl get --with-secrets

Without this, the resource we fetch may be missing important details
that get overwritten when the edit completes.

Fixes #20326
2023-01-18 09:32:22 -07:00
Zac Bergquist cfb40186e1 tctl: add edit command (#18826)
This command allows you to modify a resource in place by opening
the resource YAML in your text editor.

The editor is selected by checking the following, in order of
precedence:

- the TELEPORT_EDITOR environment variable
- the VISUAL environment variable
- the EDITOR environment variable
- defaulting to 'vi'

We also prevent renaming resources with this command.
See gravitational/webapps#1465 where we do the same for the web UI.
2022-12-29 17:30:14 -07:00