Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added HostInfo output to Node response #1938

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

hopleus
Copy link

@hopleus hopleus commented May 14, 2024

  • have read the CONTRIBUTING.md file
  • 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

Usecase

As an administrator, I want to see the information that is available only in HostInfo, for example, the version of the client's TailScale, the OS name, its version, etc.

@hopleus
Copy link
Author

hopleus commented May 14, 2024

@juanfont, I saw your comment #1205 (comment) but I think that adding the base fields from HostInfo will not affect the HeadScale in any way, because it is unlikely that TailScale will change the fields used in any way

@kradalby
Copy link
Collaborator

Quoting the issue referred above:

After discussing it with @kradalby, we reckon it would be safer/saner for Headscale if you just marshal the Machine.HostInfo as a string into gRPC, rather than transforming it into a proto object in Headscale. This way, if something changes (and it might from Tailscale side) Headscale would not be affected.

We cannot maintain all these field hand typed into the API, however just marshalling it as JSON and then unmarshalling it on the other side using tailcfg.Hostinfo would be fine.

If this is implemented, it should also be part of the JSON output of headscale nodes list --json and it should have integration tests to verify the output.

As mentioned in our contribution guidelines, all contributions needs tests and there are a few more tickboxes that has not been addressed.

@hopleus
Copy link
Author

hopleus commented May 14, 2024

Quoting the issue referred above:

After discussing it with @kradalby, we reckon it would be safer/saner for Headscale if you just marshal the Machine.HostInfo as a string into gRPC, rather than transforming it into a proto object in Headscale. This way, if something changes (and it might from Tailscale side) Headscale would not be affected.

We cannot maintain all these field hand typed into the API, however just marshalling it as JSON and then unmarshalling it on the other side using tailcfg.Hostinfo would be fine.

If this is implemented, it should also be part of the JSON output of headscale nodes list --json and it should have integration tests to verify the output.

As mentioned in our contribution guidelines, all contributions needs tests and there are a few more tickboxes that has not been addressed.

Replaced with marshaling in JSON (protobuf.Struct).
Now, in the api, as well as through the cli, what is stored in the database will be output, without any processing

hscontrol/types/node.go Outdated Show resolved Hide resolved
integration/cli_test.go Outdated Show resolved Hide resolved
proto/headscale/v1/node.proto Outdated Show resolved Hide resolved
@hopleus hopleus requested a review from kradalby May 16, 2024 19:07
hscontrol/types/node.go Outdated Show resolved Hide resolved
hscontrol/types/node.go Outdated Show resolved Hide resolved
integration/cli_test.go Outdated Show resolved Hide resolved
@hopleus hopleus requested a review from kradalby May 18, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants