-
Notifications
You must be signed in to change notification settings - Fork 17
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
Label Templates: add IP addresses to the Network variables #885
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add respective tests
1c5c958
to
37b376d
Compare
37b376d
to
dffaec3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a few nitpicks.
However I'm worried about the implicit behavior of showing IPv4 before IPv6. Why not both?
My proposal is to explicitly implement *.ipv4
and *.ipv6
annotations.
Makes it also easier to parse the value, so that you don't have to implement a isIPv4?
filter for example.
Last but not least, this PR enables this behavior by default, I wonder if this is the desired behavior for everyone or maybe this is worth a new toggle, like a new flag in the MachineRegistration to enable or not reporting of IPs.
If we have the toggle I'd still enable it by default, as this is very nice to have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't mean to approve it, pressed the wrong button. :(
Well, have to confess I was mainly looking at the final goal to have an IP address for k3s/RKE2 internal/external address values, and so ended up looking just for one IP address.. but good point, doesn't makes much sense to do this kind of filtering at the annotation level, would make more sense to have ipv4 and ipv6 👍🏼 |
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
dffaec3
to
a0d4639
Compare
Signed-off-by: Francesco Giudici <[email protected]>
track all available network addresses Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
a0d4639
to
84d3b51
Compare
Changed PR to just expose IP addresses as Network variables (on demand). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you for the changes!
* util: add network util functions Signed-off-by: Francesco Giudici <[email protected]> * Label Templates: add IPAddress to the Network vars Signed-off-by: Francesco Giudici <[email protected]> * util/net: rework to allow mocking system ip address retrieval Signed-off-by: Francesco Giudici <[email protected]> * util/net: return all the available network addresses Signed-off-by: Francesco Giudici <[email protected]> * Label Templates: add IPAddresses.{num} to the Network vars track all available network addresses Signed-off-by: Francesco Giudici <[email protected]> * make generate-mocks Signed-off-by: Francesco Giudici <[email protected]> * tests: add util/net coverage Signed-off-by: Francesco Giudici <[email protected]> * error strings should not be capitalized Signed-off-by: Francesco Giudici <[email protected]> --------- Signed-off-by: Francesco Giudici <[email protected]> (cherry picked from commit 5e14e96)
* util: add network util functions Signed-off-by: Francesco Giudici <[email protected]> * Label Templates: add IPAddress to the Network vars Signed-off-by: Francesco Giudici <[email protected]> * util/net: rework to allow mocking system ip address retrieval Signed-off-by: Francesco Giudici <[email protected]> * util/net: return all the available network addresses Signed-off-by: Francesco Giudici <[email protected]> * Label Templates: add IPAddresses.{num} to the Network vars track all available network addresses Signed-off-by: Francesco Giudici <[email protected]> * make generate-mocks Signed-off-by: Francesco Giudici <[email protected]> * tests: add util/net coverage Signed-off-by: Francesco Giudici <[email protected]> * error strings should not be capitalized Signed-off-by: Francesco Giudici <[email protected]> --------- Signed-off-by: Francesco Giudici <[email protected]> (cherry picked from commit 5e14e96)
Add the IPv4 and IPv6 addresses to the NICs template variables.
In particular:
Example:
Part of #855