Skip to content

feat: Implement /network-config Version 1 endpoint and enhance metadata with network interface details#2

Merged
alexlovelltroy merged 2 commits into
mainfrom
feature/network-config
Jan 5, 2026
Merged

feat: Implement /network-config Version 1 endpoint and enhance metadata with network interface details#2
alexlovelltroy merged 2 commits into
mainfrom
feature/network-config

Conversation

@alexlovelltroy
Copy link
Copy Markdown
Member

Description

Please include a summary of the change and which issue is fixed.
Also include relevant motivation and context.

This pull request adds support for returning detailed network interface information in instance metadata and introduces a new /network-config endpoint to provide cloud-init compatible network configuration. It updates the mock SMD client and tests to support and verify the new network interface data, and enhances the documentation to describe these new features.

Network interface information in metadata:

  • The instance metadata now includes a detailed list of network interfaces, with information such as interface name, MAC address, IP address, network, description, enabled status, and Redfish ID, all sourced from SMD discovery. This is reflected in both the metadata structure and the documentation. [1] [2] [3] [4]

  • The generateMetaData function and related handlers were updated to fetch and include network interface details from SMD, and a helper buildInterfacesArray was added to combine NIC and interface data for template rendering. [1] [2] [3]

New /network-config endpoint:

  • A new HTTP endpoint /network-config was added to return the cloud-init network configuration (v1 YAML format) for the requesting node, automatically discovering all network interfaces and returning static IP configuration based on SMD data. [1] [2] [3]

Mock data and testing improvements:

  • The mock SMD client was enhanced to include Ethernet NIC and interface data for multiple components, supporting multi-NIC scenarios in tests.

  • A new unit test was added to verify that the metadata handler correctly includes network interface information in its output.

Template and group metadata enhancements:

  • The group user data handler was updated to inject network interface information into the merged metadata for template rendering, ensuring group templates can access interface details.

Documentation updates:

  • The CLOUDINIT.md documentation was updated to describe the new network interface information in instance metadata and to document the /network-config endpoint, including example responses. [1] [2] [3]

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

…twork interface details

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
@alexlovelltroy alexlovelltroy merged commit 521fa62 into main Jan 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant