Skip to content

Commit 17bd778

Browse files
Hostname validation: document invalid hostnames (#49653)
1 parent cd21ab3 commit 17bd778

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

docs/pages/admin-guides/management/guides/ec2-tags.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ this way will have the `aws/` prefix. When the Teleport process starts, it fetch
1010
the instance metadata service and adds them as labels. The process will update the tags every hour,
1111
so newly created or deleted tags will be reflected in the labels.
1212

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

1515
```bash
1616
$ tsh ls

docs/pages/admin-guides/management/guides/gcp-tags.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ When the Teleport process starts, it fetches all tags and labels from
1717
the GCP API and adds them as labels. The process will update the tags every hour,
1818
so newly created or deleted tags will be reflected in the labels.
1919

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

2323
```bash

lib/utils/utils_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,16 @@ func TestIsValidHostname(t *testing.T) {
234234
hostname: "some-host-1.example.com",
235235
assert: require.True,
236236
},
237+
{
238+
name: "only lower case works",
239+
hostname: "only-lower-case-works",
240+
assert: require.True,
241+
},
242+
{
243+
name: "mixed upper case fails",
244+
hostname: "mixed-UPPER-CASE-fails",
245+
assert: require.False,
246+
},
237247
{
238248
name: "one component",
239249
hostname: "example",

0 commit comments

Comments
 (0)