Lint fixes 1/n
This commit is contained in:
parent
58c336e7f4
commit
10cd87e5a2
9 changed files with 81 additions and 80 deletions
|
@ -27,6 +27,7 @@ const (
|
|||
errCouldNotConvertMachineInterface = Error("failed to convert machine interface")
|
||||
errHostnameTooLong = Error("Hostname too long")
|
||||
MachineGivenNameHashLength = 8
|
||||
MachineGivenNameTrimSize = 2
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -898,7 +899,7 @@ func (machine *Machine) RoutesToProto() *v1.Routes {
|
|||
func (h *Headscale) GenerateGivenName(suppliedName string) (string, error) {
|
||||
// If a hostname is or will be longer than 63 chars after adding the hash,
|
||||
// it needs to be trimmed.
|
||||
trimmedHostnameLength := labelHostnameLength - MachineGivenNameHashLength - 2
|
||||
trimmedHostnameLength := labelHostnameLength - MachineGivenNameHashLength - MachineGivenNameTrimSize
|
||||
|
||||
normalizedHostname, err := NormalizeToFQDNRules(
|
||||
suppliedName,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue