[PR #771] [MERGED] Random suffix only on hostname collision in namespace. #1635

Closed
opened 2025-12-29 02:31:01 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/771
Author: @shanna
Created: 8/31/2022
Status: Merged
Merged: 10/21/2022
Merged by: @kradalby

Base: mainHead: feature-random-suffix-on-collision


📝 Commits (9)

  • 2aebd29 Random suffix only on collision.
  • a3d3ad2 docs(README): update contributors
  • df36bcf Fix machine test from marger
  • d56ad29 Fix nolint comment
  • 03194e2 Merge branch 'main' into feature-random-suffix-on-collision
  • 40b3de9 Merge branch 'main' into feature-random-suffix-on-collision
  • 830d59f Merge branch 'main' into feature-random-suffix-on-collision
  • bc1c1f5 Fix most nil pointers, actually make it check for unique across headscale
  • 2d170fe update tests

📊 Changes

6 files changed (+162 additions, -42 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 grpcv1.go (+1 -1)
📝 integration/general_test.go (+4 -4)
📝 machine.go (+62 -13)
📝 machine_test.go (+89 -22)
📝 protocol_common.go (+5 -2)

📄 Description

Implements random suffixes only on hostname collision. Resolves #766.

0.16.0 introduced random suffixes to all machine given names (DNS hostnames) regardless of collisions within a namespace. This PR 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/

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/771 **Author:** [@shanna](https://github.com/shanna) **Created:** 8/31/2022 **Status:** ✅ Merged **Merged:** 10/21/2022 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `feature-random-suffix-on-collision` --- ### 📝 Commits (9) - [`2aebd29`](https://github.com/juanfont/headscale/commit/2aebd2927dab9793f5efb693e0678796c6c95f4e) Random suffix only on collision. - [`a3d3ad2`](https://github.com/juanfont/headscale/commit/a3d3ad220826f881194ed47015b716f502bbbedd) docs(README): update contributors - [`df36bcf`](https://github.com/juanfont/headscale/commit/df36bcfd39a5c246de91e4f5f647a569bfa16afe) Fix machine test from marger - [`d56ad29`](https://github.com/juanfont/headscale/commit/d56ad2917d4b4bb6d4fd171ac5bdda3400c1c5dd) Fix nolint comment - [`03194e2`](https://github.com/juanfont/headscale/commit/03194e2d66695df77cf0f91e2d00e32a4e8b9ab0) Merge branch 'main' into feature-random-suffix-on-collision - [`40b3de9`](https://github.com/juanfont/headscale/commit/40b3de989470d1b6c1c9936dcfc9c1bbfcd6af47) Merge branch 'main' into feature-random-suffix-on-collision - [`830d59f`](https://github.com/juanfont/headscale/commit/830d59fe8c45bade28e0b467652e35cc47d7356f) Merge branch 'main' into feature-random-suffix-on-collision - [`bc1c1f5`](https://github.com/juanfont/headscale/commit/bc1c1f5ce87201048fc82bac76b547160eda6730) Fix most nil pointers, actually make it check for unique across headscale - [`2d170fe`](https://github.com/juanfont/headscale/commit/2d170fe339920be8ec9e87e77cbffde8bbae8553) update tests ### 📊 Changes **6 files changed** (+162 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `grpcv1.go` (+1 -1) 📝 `integration/general_test.go` (+4 -4) 📝 `machine.go` (+62 -13) 📝 `machine_test.go` (+89 -22) 📝 `protocol_common.go` (+5 -2) </details> ### 📄 Description Implements random suffixes only on hostname collision. Resolves #766. 0.16.0 introduced random suffixes to all machine given names (DNS hostnames) regardless of collisions within a namespace. This PR 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/ <!-- Please tick if the following things apply. You… --> - [x] read the [CONTRIBUTING guidelines](README.md#contributing) - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [x] added unit tests - [x] added integration tests - [x] updated documentation if needed - [x] updated CHANGELOG.md <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:31:01 +01:00
adam closed this issue 2025-12-29 02:31:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1635