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

tctl - Add --set flags for every trait #14552

Merged
merged 6 commits into from
Aug 1, 2022
Merged

Conversation

atburke
Copy link
Contributor

@atburke atburke commented Jul 16, 2022

This PR adds a --set flag to tctl users update for every trait where it wasn't implemented already (Windows logins, Kube users/groups, DB users/names, and AWS role ARNs).

$ tctl users update \
--set-windows-logins winA,winB \
--set-kubernetes-users ku1 \
--set-kubernetes-groups kg1,kg2 \
--set-db-users a,b,c \
--set-db-names x,y,z \
--set-aws-role-arns foo,bar,baz andrew
User andrew has been updated:
	New database users: a,b,c
	New database names: x,y,z
	New AWS role ARNs: foo,bar,baz
	New Windows logins: winA,winB
	New Kubernetes users: ku1
	New Kubernetes groups: kg1,kg2

Part of #13783.

Closes #15083

@github-actions github-actions bot added the tctl tctl - Teleport admin tool label Jul 16, 2022
@github-actions github-actions bot requested review from alistanis and r0mant July 16, 2022 00:04
Copy link
Contributor

@jakule jakule left a comment

Choose a reason for hiding this comment

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

Can you add some tests?

@alistanis
Copy link
Contributor

Can you add some tests?

There isn't currently a lot of coverage for tctl users (at least it doesn't look like it at a glance) but there is a test file in tool/tctl/common/user_command_test.go. I would say take a look at how difficult adding tests for this is going to be; it'll require an IdentityService attached to a ClientI at a minimum I think, for which I'm not sure if we have mocks or not. If we don't already have mocks, maybe take a quick look at tool/tsh/tsh_test.go and look at invoking tctl directly instead and testing that?

@github-actions github-actions bot removed the request for review from r0mant August 1, 2022 22:22
@atburke atburke merged commit 4653503 into master Aug 1, 2022
@github-actions
Copy link

github-actions bot commented Aug 1, 2022

@atburke See the table below for backport results.

Branch Result
branch/v10 Failed

atburke added a commit that referenced this pull request Aug 1, 2022
This change adds a --set flag to tctl users update for every trait where it wasn't implemented already (Windows logins, Kube users/groups, DB users/names, and AWS role ARNs).
atburke added a commit that referenced this pull request Aug 2, 2022
This change adds a --set flag to tctl users update for every trait where it wasn't implemented already (Windows logins, Kube users/groups, DB users/names, and AWS role ARNs).
@zmb3 zmb3 deleted the atburke/tsh-user-update branch September 9, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't set user logins on existent account
3 participants