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

[v15] Hostname validation: document invalid hostnames #49653

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/admin-guides/management/guides/ec2-tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ this way will have the `aws/` prefix. When the Teleport process starts, it fetch
the instance metadata service and adds them as labels. The process will update the tags every hour,
so newly created or deleted tags will be reflected in the labels.

If the tag `TeleportHostname` (case-sensitive) is present, its value will override the node's hostname.
If the tag `TeleportHostname` is present, its value (must be lower case) will override the node's hostname.

```bash
$ tsh ls
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/admin-guides/management/guides/gcp-tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ When the Teleport process starts, it fetches all tags and labels from
the GCP API and adds them as labels. The process will update the tags every hour,
so newly created or deleted tags will be reflected in the labels.

If the GCP label `TeleportHostname` (case-sensitive) is present, its value will override the node's hostname. This
If the GCP label `TeleportHostname` is present, its value (must be lower case) will override the node's hostname. This
does not apply to GCP tags.

```bash
Expand Down
10 changes: 10 additions & 0 deletions lib/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,16 @@ func TestIsValidHostname(t *testing.T) {
hostname: "some-host-1.example.com",
assert: require.True,
},
{
name: "only lower case works",
hostname: "only-lower-case-works",
assert: require.True,
},
{
name: "mixed upper case fails",
hostname: "mixed-UPPER-CASE-fails",
assert: require.False,
},
{
name: "one component",
hostname: "example",
Expand Down
Loading