mirror of
https://github.com/gravitational/teleport.git
synced 2026-10-12 02:15:01 +00:00
Hostname validation: document invalid hostnames (#49549)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user