[PR #200] [MERGED] Cli improvements -- nodes subcommand #1317

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/200
Author: @cure
Created: 10/24/2021
Status: Merged
Merged: 10/29/2021
Merged by: @cure

Base: mainHead: cli-improvements


📝 Commits (10+)

  • c8e1afb When attempting to unshare a node from the primary namespace, return
  • dd75578 cli changes for the nodes subcommand:
  • 1d9954d Fix integration test.
  • c76d3b5 Merge branch 'main' into cli-improvements
  • f9ece00 Make the cli help a little more explicit for the nodes subcommand.
  • d086cf4 Move the namespace argument back to a flag for the share and unshare
  • 6c01b86 Update cmd/headscale/cli/nodes.go
  • b00a272 Update cmd/headscale/cli/nodes.go
  • 25c67cf Update integration_test.go
  • f9187bd Switch to named arguments for all nodes subcommands. Update docs

📊 Changes

6 files changed (+127 additions, -109 deletions)

View changed files

📝 api.go (+1 -1)
📝 cmd/headscale/cli/nodes.go (+117 -103)
📝 docs/Running.md (+3 -3)
📝 integration_test.go (+1 -1)
📝 sharing.go (+2 -1)
📝 sharing_test.go (+3 -0)

📄 Description

cli changes for the nodes subcommand:

  • when listing nodes, a namespace is now optional, when it is not provided, all nodes are shown
  • when deleting, and sharing a node, remove the namespace flag, it was superfluous and unused
  • when unsharing a node, specify the namespace as an argument not a flag, making the UX the same as for sharing.

Also refactor the share/unshare code to reuse the shared bits.

Finally, fix error message when attempting to unshare a node from the primary namespace.

If this approach looks good, I'll make a similar PR for the preauthkeys and routes subcommands.


🔄 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/200 **Author:** [@cure](https://github.com/cure) **Created:** 10/24/2021 **Status:** ✅ Merged **Merged:** 10/29/2021 **Merged by:** [@cure](https://github.com/cure) **Base:** `main` ← **Head:** `cli-improvements` --- ### 📝 Commits (10+) - [`c8e1afb`](https://github.com/juanfont/headscale/commit/c8e1afb14b9bf8db67b3cebdb1a90c184382ec3f) When attempting to unshare a node from the primary namespace, return - [`dd75578`](https://github.com/juanfont/headscale/commit/dd7557850ec07e23d0c075998ffe1d84d9e3cf3b) cli changes for the `nodes` subcommand: - [`1d9954d`](https://github.com/juanfont/headscale/commit/1d9954d8e9a247428121262383da2e6017a60bc7) Fix integration test. - [`c76d3b5`](https://github.com/juanfont/headscale/commit/c76d3b53d984676e02e13dfd01102c55f823aaa4) Merge branch 'main' into cli-improvements - [`f9ece00`](https://github.com/juanfont/headscale/commit/f9ece0087d0e0cbbf1ae726cce2eed340d53ed91) Make the cli help a little more explicit for the nodes subcommand. - [`d086cf4`](https://github.com/juanfont/headscale/commit/d086cf469137f8116579e776daf010a4e6c662d8) Move the namespace argument back to a flag for the share and unshare - [`6c01b86`](https://github.com/juanfont/headscale/commit/6c01b86e4ce5cbc36dc012ca2fc86a9856dcef43) Update cmd/headscale/cli/nodes.go - [`b00a272`](https://github.com/juanfont/headscale/commit/b00a2729e3b250b30fd995647123e81614ffcd7f) Update cmd/headscale/cli/nodes.go - [`25c67cf`](https://github.com/juanfont/headscale/commit/25c67cf2aa8a18b4443400cae98d8d7899611293) Update integration_test.go - [`f9187bd`](https://github.com/juanfont/headscale/commit/f9187bdfc4e1c7c269622a3c595d393d26ae5f8e) Switch to named arguments for all `nodes` subcommands. Update docs ### 📊 Changes **6 files changed** (+127 additions, -109 deletions) <details> <summary>View changed files</summary> 📝 `api.go` (+1 -1) 📝 `cmd/headscale/cli/nodes.go` (+117 -103) 📝 `docs/Running.md` (+3 -3) 📝 `integration_test.go` (+1 -1) 📝 `sharing.go` (+2 -1) 📝 `sharing_test.go` (+3 -0) </details> ### 📄 Description cli changes for the `nodes` subcommand: * when listing nodes, a namespace is now optional, when it is not provided, all nodes are shown * when deleting, and sharing a node, remove the `namespace` flag, it was superfluous and unused * when unsharing a node, specify the namespace as an argument not a flag, making the UX the same as for sharing. Also refactor the share/unshare code to reuse the shared bits. Finally, fix error message when attempting to unshare a node from the primary namespace. If this approach looks good, I'll make a similar PR for the preauthkeys and routes subcommands. --- <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:29:40 +01:00
adam closed this issue 2025-12-29 02:29:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1317