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

The sockaddr.Include and sockaddr.Exclude do not have "private" selector. #328

Closed
kwilczynski opened this issue May 14, 2018 · 4 comments
Closed

Comments

@kwilczynski
Copy link
Contributor

kwilczynski commented May 14, 2018

Hi @hairyhenderson,

I've noticed that the documentation mentions that the sockaddr.Exclude and sockaddr.Include support a "private" selector, but it does not seem to be the case, for instance:

$ gomplate -i '{{ sockaddr.GetAllInterfaces | sockaddr.Include "private" "" }}'
Error: template: <arg>:1:39: executing "<arg>" at <sockaddr.Include>: error calling Include: invalid include selector "private"

Which is correct as per the ifaddrs.go implementation.

To achieve this (somewhat), one would have to use the rfc selector with an appropriate numeric RFC code. Alternatively, we could send a Pull Request against go-sockaddr to add this include/exclude filter.

Would you like to send a Pull Request to update documentation?

@kwilczynski
Copy link
Contributor Author

I have opened a Pull Request at hashicorp/go-sockaddr#23 to add support for private to the include and exclude filters.

@hairyhenderson
Copy link
Owner

Hi @kwilczynski! Thanks for logging this issue. I'm really not sure why I documented private in there - probably a copy/paste error from Sort.

If you'd like to issue a PR to fix the doc, that'd be great!

From what I can see, doing sockaddr.Include "rfc" "6890" should accomplish what you're looking for. With Sort, private is really just a wrapper around the RFC 6890 comparator.

@kwilczynski
Copy link
Contributor Author

Hi @hairyhenderson,

No worries! Fix to the documentation coming right up!

@hairyhenderson
Copy link
Owner

Fixed in #329

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants