-
Notifications
You must be signed in to change notification settings - Fork 260
feat: add support for windows MAC hex dump #4122
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
base: master
Are you sure you want to change the base?
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.
Pull Request Overview
This PR adds support for parsing Windows MAC address format from IMDS, which returns MAC addresses as hex dumps without delimiters (e.g., "00005e005302" instead of "00:00:5e:00:53:02").
- Introduces a new
parseMacAddresshelper function that detects hex dump format and adds delimiters before parsing - Updates test data to include a Windows-format MAC address to verify the new parsing logic
- Maintains backward compatibility with standard delimited MAC address formats
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cns/imds/client.go | Adds parseMacAddress function to handle Windows hex dump MAC format by detecting undelimited strings and inserting colons before parsing with net.ParseMAC |
| cns/imds/client_test.go | Updates test data to include a Windows-format MAC address ("00005e005302") to validate the new parsing capability |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run Azure Container Networking PR |
|
Commenter does not have sufficient privileges for PR 4122 in repo Azure/azure-container-networking |
|
/azp run Azure Container Networking PR |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* feat: add support for windows MAC hex dump * test: invalid MAC address length * fix: typo * fix: comment --------- Co-authored-by: Keith Nguyen <keithnguyen@microsoft.com>
Reason for Change:
The
net.ParseMACfunction does not support windows MAC address, which is a hex dump without delimiter, so we make a wrapper to add colon:delimiters to the MAC address before parsing if it doesn't have any delimiter.Issue Fixed:
Requirements:
Notes: