mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-04 01:46:16 +08:00
* Add new `tctl bots update` command This adds a new command to update roles and logins for existing bots, with flags to both set and append as desired. changelog: Add new `tctl bots update` command to update bot roles and logins * Pluralize "add-" flags for consistency * Add docs for `tctl bots update` Also merges in some other misc docs changes for `tctl bots ...` * Fix docs lint * Fix incorrect example * Apply suggestions from code review Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com> * Use the bot service's `UpdateBot()` RPC instead of modifying directly This switches to use the new `UpdateBot()` RPC instead of modifying the bot user and role directly. Also, tweaks CLI messaging to be a bit less chatty. * Update tool/tctl/common/bots_command.go Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com> * Move set functions into their own reusable package The set package adds a little extra functionality but is still missing various important functions, like subset/superset, difference, intersection, xor/symmetric difference, etc. This changes the API slightly, so the tctl command is updated to use the new package. * Remove duplicate tests * Reword flag help strings for clarity * Remove set abstraction Removes the Set package and unrolls all related function calls in bots_command. * Add unit tests for `updateBotLogins()` and `updateBotRoles()` This also makes a minimal API wrapper interface for mocking. * Use utils function to convert sets to a string slice * Update docs/pages/reference/cli/tctl.mdx Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com> --------- Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com> Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com> Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>