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

Display correct error message when host is missing in tctl auth sign #10588

Merged
merged 2 commits into from
Feb 28, 2022

Conversation

jakule
Copy link
Contributor

@jakule jakule commented Feb 24, 2022

Currently when no --host flag is passed to tctl auth sign --format=db

User Message: missing parameter Subject.Common name

is being printed instead of intended:

User Message: at least one hostname must be specified via --host flag

Explanation: https://pkg.go.dev/strings#Split

If s does not contain sep and sep is not empty, Split returns a slice of length 1 whose only element is s.

@jakule jakule requested a review from r0mant February 24, 2022 17:17
@github-actions github-actions bot added the tctl tctl - Teleport admin tool label Feb 24, 2022
@github-actions github-actions bot requested review from ravicious and zmb3 February 24, 2022 17:18
Copy link
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Let's backport to at least v9/v8. Maybe v7 too.

@jakule jakule force-pushed the jakule/tctl-missing-host-fix branch from a7ec6b6 to e9c2e47 Compare February 28, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-required tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants