Hostname validation: document invalid hostnames (#49549)

This commit is contained in:
Marco Dinis
2024-12-02 17:23:11 +00:00
committed by GitHub
parent 1a45e8ab32
commit 41facd9cd6
3 changed files with 12 additions and 2 deletions
@@ -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.
```code
$ tsh ls
@@ -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.
```code
+10
View File
@@ -270,6 +270,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",