[PR #558] [MERGED] Add command to force tags on nodes and list tags #1481

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/558
Author: @restanrm
Created: 4/21/2022
Status: Merged
Merged: 5/16/2022
Merged by: @kradalby

Base: mainHead: feat-list-tags-of-machines


📝 Commits (10+)

  • 02f68eb feat: add forcedTags field and update proto
  • 9de9bc2 feat(cli): add tag subcommand to add and remove tags
  • cd1d107 feat(acls): add support for forced tags
  • 98f54c9 chore: apply format and lint
  • 587bdc7 feat: add valid and invalid fields
  • db1528b feat: add invalid and valid tags to grpc response
  • 89a1a56 feat: add unit tests and fmt
  • 4fcc5e2 chore: fmt for grpc file
  • 4651c44 feat: print tags in nodes list
  • ea7bcff Merge branch 'main' into feat-list-tags-of-machines

📊 Changes

25 files changed (+1470 additions, -351 deletions)

View changed files

📝 .github/workflows/lint.yml (+1 -1)
📝 .golangci.yaml (+2 -0)
📝 CHANGELOG.md (+2 -0)
📝 acls.go (+26 -3)
📝 acls_test.go (+79 -0)
📝 cmd/headscale/cli/nodes.go (+134 -28)
📝 cmd/headscale/cli/utils.go (+13 -1)
📝 derp_server.go (+13 -4)
📝 flake.nix (+1 -1)
📝 gen/go/headscale/v1/headscale.pb.go (+154 -143)
📝 gen/go/headscale/v1/headscale.pb.gw.go (+115 -0)
📝 gen/go/headscale/v1/headscale_grpc.pb.go (+40 -0)
📝 gen/go/headscale/v1/machine.pb.go (+308 -140)
📝 gen/openapiv2/headscale/v1/headscale.swagger.json (+73 -0)
📝 go.mod (+16 -1)
📝 go.sum (+47 -0)
📝 grpcv1.go (+48 -2)
📝 integration_cli_test.go (+129 -0)
📝 integration_embedded_derp_test.go (+15 -4)
📝 machine.go (+62 -2)

...and 5 more files

📄 Description

  • 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 PR will fix #356 and fix #525

Work to be done before finalisation of this PR

  • Handle validation errors or normalisation of the name of the tags (tags must start with the tag: prefix)
    this means that we should define a way to return errors in the protobuf. Should we define status and message ?
  • replace add/del in CLI by set
  • make a generic contains function
  • change updateDBMachine to UpdateTags
  • add integration tests
  • add documentation

image


🔄 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/558 **Author:** [@restanrm](https://github.com/restanrm) **Created:** 4/21/2022 **Status:** ✅ Merged **Merged:** 5/16/2022 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `feat-list-tags-of-machines` --- ### 📝 Commits (10+) - [`02f68eb`](https://github.com/juanfont/headscale/commit/02f68ebac895724e3f7a3e9b50ce55b8e0090d1a) feat: add forcedTags field and update proto - [`9de9bc2`](https://github.com/juanfont/headscale/commit/9de9bc23f895b653dc63d08a5e9a314aaf37acba) feat(cli): add tag subcommand to add and remove tags - [`cd1d107`](https://github.com/juanfont/headscale/commit/cd1d10761fe09d5f83d948d5ab6d39ccc3c5e4f2) feat(acls): add support for forced tags - [`98f54c9`](https://github.com/juanfont/headscale/commit/98f54c9f7f9044f1d309c5ee26562e1e22bcca7f) chore: apply format and lint - [`587bdc7`](https://github.com/juanfont/headscale/commit/587bdc75deb9c7f8d20989af7f187b8f9d33041e) feat: add valid and invalid fields - [`db1528b`](https://github.com/juanfont/headscale/commit/db1528bc73b3e6e7a058258fc8b81c0d44b14d31) feat: add invalid and valid tags to grpc response - [`89a1a56`](https://github.com/juanfont/headscale/commit/89a1a56328ed2e8f1e288faa1e4ad4a9c2c6122b) feat: add unit tests and fmt - [`4fcc5e2`](https://github.com/juanfont/headscale/commit/4fcc5e253c098f93df39a72c4c7ea8c4cf4f2a86) chore: fmt for grpc file - [`4651c44`](https://github.com/juanfont/headscale/commit/4651c44ddef68da67f34910729f874fc4a5c8681) feat: print tags in nodes list - [`ea7bcff`](https://github.com/juanfont/headscale/commit/ea7bcfffbbb445534cec77492fb49cd43a671c8c) Merge branch 'main' into feat-list-tags-of-machines ### 📊 Changes **25 files changed** (+1470 additions, -351 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/lint.yml` (+1 -1) 📝 `.golangci.yaml` (+2 -0) 📝 `CHANGELOG.md` (+2 -0) 📝 `acls.go` (+26 -3) 📝 `acls_test.go` (+79 -0) 📝 `cmd/headscale/cli/nodes.go` (+134 -28) 📝 `cmd/headscale/cli/utils.go` (+13 -1) 📝 `derp_server.go` (+13 -4) 📝 `flake.nix` (+1 -1) 📝 `gen/go/headscale/v1/headscale.pb.go` (+154 -143) 📝 `gen/go/headscale/v1/headscale.pb.gw.go` (+115 -0) 📝 `gen/go/headscale/v1/headscale_grpc.pb.go` (+40 -0) 📝 `gen/go/headscale/v1/machine.pb.go` (+308 -140) 📝 `gen/openapiv2/headscale/v1/headscale.swagger.json` (+73 -0) 📝 `go.mod` (+16 -1) 📝 `go.sum` (+47 -0) 📝 `grpcv1.go` (+48 -2) 📝 `integration_cli_test.go` (+129 -0) 📝 `integration_embedded_derp_test.go` (+15 -4) 📝 `machine.go` (+62 -2) _...and 5 more files_ </details> ### 📄 Description <!-- Please tick if the following things apply. You… --> - [x] read the [CONTRIBUTING guidelines](README.md#user-content-contributing) - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [x] added unit tests - [x] added integration tests - [ ] updated documentation if needed - [x] updated CHANGELOG.md This PR will fix #356 and fix #525 Work to be done before finalisation of this PR - [x] Handle validation errors or normalisation of the name of the tags (tags must start with the `tag:` prefix) this means that we should define a way to return errors in the protobuf. Should we define status and message ? - [x] replace add/del in CLI by set - [x] make a generic `contains` function - [x] change `updateDBMachine` to `UpdateTags` - [x] add integration tests - [ ] add documentation ![image](https://user-images.githubusercontent.com/4344371/168309389-fd492f99-9b46-4a86-a80c-a3eafac0b613.png) --- <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:30:13 +01:00
adam closed this issue 2025-12-29 02:30:13 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1481