Skip to content

types/network: introduce MACAddress type (temporary placement)#51319

Closed
2003Aditya wants to merge 1 commit intomoby:masterfrom
2003Aditya:fix-macaddress-type
Closed

types/network: introduce MACAddress type (temporary placement)#51319
2003Aditya wants to merge 1 commit intomoby:masterfrom
2003Aditya:fix-macaddress-type

Conversation

@2003Aditya
Copy link
Contributor

@2003Aditya 2003Aditya commented Oct 29, 2025

Fixes #51146

- What I did

Introduced a new MACAddress type that wraps net.HardwareAddr with custom JSON marshaling and unmarshaling logic to ensure consistent serialization/deserialization of MAC addresses.
Currently added in api/types/network/endpoint.go temporarily for review and discussion on ideal placement.

- How I did it

  • Defined a new MACAddress type with String(), MarshalJSON(), and UnmarshalJSON() methods.
  • Replaced the MacAddress field in EndpointSettings with this new type.
  • Rebuilt and ran dockerd from this branch.
  • Created and inspected containers to confirm correct MacAddress serialization.

@thaJeztah
Copy link
Member

Thank you for contributing! It appears your commit message is missing a DCO sign-off,
causing the DCO check to fail.

We require all commit messages to have a Signed-off-by line with your name
and e-mail (see "Sign your work"
in the CONTRIBUTING.md in this repository), which looks something like:

Signed-off-by: YourFirsName YourLastName <yourname@example.org>

There is no need to open a new pull request, but to fix this (and make CI pass),
you need to amend the commit(s) in this pull request, and "force push" the amended
commit.

Unfortunately, it's not possible to do so through GitHub's web UI, so this needs
to be done through the git commandline.

You can find some instructions in the output of the DCO check (which can be found
in the "checks" tab on this pull request), as well as in the Moby contributing guide.

Steps to do so "roughly" come down to:

  1. Set your name and e-mail in git's configuration:

    git config --global user.name "YourFirstName YourLastName"
    git config --global user.email "yourname@example.org"

    (Make sure to use your real name (not your GitHub username/handle) and e-mail)

  2. Clone your fork locally

  3. Check out the branch associated with this pull request

  4. Sign-off and amend the existing commit(s)

    git commit --amend --no-edit --signoff

    If your pull request contains multiple commits, either squash the commits (if
    needed) or sign-off each individual commit.

  5. Force push your branch to GitHub (using the --force or --force-with-lease flags) to update the pull request.

Sorry for the hassle (I wish GitHub would make this a bit easier to do), and let me know if you need help or more detailed instructions!

@thaJeztah thaJeztah added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Oct 30, 2025
@2003Aditya
Copy link
Contributor Author

@thaJeztah Thank you for pointing that out! I’m sorry sir, I missed that. I’ll follow your instructions and fix it right away.

@thaJeztah
Copy link
Member

@2003Aditya no worries! We discussed the related ticket in our maintainers call, and it looks like some more changes were needed; as we wanted to get these changes in before tagging the next beta of the API module, @corhere volunteered to work on making this change.

Hope that's ok for you (sorry for going that route, but we had to move fast on this one 😅); please don't let that stop you from contributing to this project! ❤️

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

Labels

area/networking Networking dco/no Automatically set by a bot when one of the commits lacks proper signature module/api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api: consider using net.HardwareAddr for MACAddress fields?

2 participants