-
Notifications
You must be signed in to change notification settings - Fork 985
Network: Show info for macvlan networks #15682
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
Conversation
simondeziel
left a comment
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.
LGTM, just a tiny comment.
This is to prevent `lxc network info <net>` failing when used on a macvlan network. Signed-off-by: Nikita Mezhenskyi <[email protected]>
Signed-off-by: Nikita Mezhenskyi <[email protected]>
Signed-off-by: Nikita Mezhenskyi <[email protected]>
8c4b9b9 to
4663df5
Compare
simondeziel
left a comment
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.
Thanks!
| mtu = parentState.Mtu | ||
| } | ||
|
|
||
| return &api.NetworkState{ |
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.
Is there a reason you didnt use the state returned by resources.GetNetworkState directly, and just modify the MTU field if the network config overrode the MTU from the parent?
Did you explicitly want to exclude the Counters and Addresses?
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.
Did you explicitly want to exclude the Counters and Addresses?
Yes, I thought these might be confusing for the user since they're related to the parent interface. As a user, I'd probably expect the Addresses to show all associated container/vm NIC IPs. And I saw that we also explicitly exclude the Counters for ovn networks.
What are your thoughts on this?
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.
And I saw that we also explicitly exclude the Counters for ovn networks.
That is because OVN networks dont have a parent as such.
I thought these might be confusing for the user since they're related to the parent interface.
Yes I suppose so, the addresses and counters of the macvlan parent, whilst might be partially relevant/associated to the NICs hanging off of it are not exclusively related to the macvlan NICs, so I think your decision makes sense.
Thanks!
| lxc network create "${ctName}net" --type=macvlan parent="${ctName}" | ||
|
|
||
| echo "==> Check that lxc network info succeeds for macvlan network." | ||
| lxc network info "${ctName}net" |
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.
Can we also test for the MTU override logic?
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.
Yes, will do
tomponline
left a comment
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.
Thanks!
Fixes #15479.
This is to prevent
lxc network info <net>failing when used on a macvlan network.Example output: