mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-25 15:37:28 +00:00
Random suffix only on collision.
0.16.0 introduced random suffixes to all machine given names (DNS hostnames) regardless of collisions within a namespace. This commit brings Headscale more inline with Tailscale by only adding a suffix if the hostname will collide within the namespace. The suffix generation differs from Tailscale. See https://tailscale.com/kb/1098/machine-names/
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//nolint
|
||||
// nolint
|
||||
package headscale
|
||||
|
||||
import (
|
||||
@@ -479,7 +479,7 @@ func (api headscaleV1APIServer) DebugCreateMachine(
|
||||
Hostname: "DebugTestMachine",
|
||||
}
|
||||
|
||||
givenName, err := api.h.GenerateGivenName(request.GetName())
|
||||
givenName, err := api.h.GenerateGivenName(namespace.Name, request.GetKey(), request.GetName())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user