-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
More robust MAC address matching #19750
Conversation
Hi @nirs. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Can one of the admins verify this patch? |
I see that this is already fixed earlier: // Need to strip 0's
mac = pkgdrivers.TrimMacAddress(mac)
if err := d.setupIP(mac); err != nil {
return err
} Probably when this failed the reason was different (firewall or evil corp vpn software). When I came back to look at this, I found the trimmed addresses in the dhcp leases. But the tests are confusing, not showing the actual entries and trimmed mac addresses, and the current code will break if bootp fixes this issue and start formatting mac addresses like other tools. If we replace trimming with parsing, we don't need to care how bootp or other programs format hw_address. |
On darwin bootp uses non-standard MAC address format[1]: "8e:1:99:9c:54:b1" instead of "8e:01:99:9c:54:b1". We fixed this by trimming leading "0" in the string before looking up the IP address. There are several issues with the current code: - Fragile, will break if bootp changes the format (unlikely) - Fixing the wrong place, the drivers should not care about the MAC address format. - The tests were confusing, showing that we can match standard MAC addresses while the actual code could match only non-standard bootp addresses. - Logging wrong MAC address since we trimmed leading zeros before logging This change replace trimming leading zeros with parsing MAC address strings and comparing the bytes. The test includes now both standard and non-standard MAC addresses. [1] https://openradar.appspot.com/FB15382970
@spowelljr can you review? you added this in 8c12c40. |
@@ -190,7 +189,7 @@ func fixMachinePermissions(path string) error { | |||
type DHCPEntry struct { | |||
Name string | |||
IPAddress string | |||
HWAddress string | |||
HWAddress net.HardwareAddr |
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.
thank you ! I like that
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, nirs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
kvm2 driver with docker runtime
Times for minikube start: 49.1s 51.3s 51.7s 52.3s 50.2s Times for minikube ingress: 15.0s 18.5s 16.0s 14.5s 16.0s docker driver with docker runtime
Times for minikube start: 22.5s 23.2s 22.3s 21.5s 20.1s Times for minikube ingress: 12.3s 13.8s 12.3s 12.8s 12.3s docker driver with containerd runtime
Times for minikube start: 24.0s 22.7s 22.6s 22.7s 22.7s Times for minikube ingress: 40.3s 39.8s 38.8s 39.3s 22.8s |
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
On darwin bootp uses non-standard MAC address format[1]:
"8e:1:99:9c:54:b1" instead of "8e:01:99:9c:54:b1". We fixed this by
trimming leading "0" in the string before looking up the IP address.
There are several issues with the current code:
address format.
addresses while the actual code could match only non-standard bootp
addresses.
logging
This change replace trimming leading zeros with parsing MAC address
strings and comparing the bytes. The test includes now both standard and
non-standard MAC addresses.
[1] https://openradar.appspot.com/FB15382970