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

[Bug] Method ‎Hosts.UnmarshalYAML does not add CIDR notation #1977

Closed
4 tasks done
Hypnotist1148 opened this issue Jun 14, 2024 · 1 comment
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@Hypnotist1148
Copy link

Hypnotist1148 commented Jun 14, 2024

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The ‎Hosts.UnmarshalJSON function checks if there is a / in the IP Address and adds the CIDR /32 if needed. the YAML equivalent (‎Hosts.UnmarshalYAML) on the other hand does not.

Expected Behavior

The ‎Hosts.UnmarshalYAML method should add the CIDR notation the the end of the IP if there is none existing.

Steps To Reproduce

  1. Use the YAML config
  2. Add a host (for example myhost) to the hosts object and use the IP 10.0.0.10
  3. You will get an error that the netip.ParsePrefix method failed to parse the IP.
  4. Now you add the CIDR /32 at the end and watch it work.

Environment

- Client OS: Arch
- Server OS: Debian 12
- Docker Image: scratch (upstream)
- Headscale version: 0.23.0-alpha12
- Tailscale version: 1.66.4 (067defc641850791142cc83a44dadae29709344a-dirty)

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

The mentioned methods can be found in the policy package on lines 64 and 93, or via this link.

@Hypnotist1148 Hypnotist1148 added the bug Something isn't working label Jun 14, 2024
@kradalby
Copy link
Collaborator

Policy does not longer support yaml, so I will close this

@kradalby kradalby closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants