feat: Implement /network-config Version 1 endpoint and enhance metadata with network interface details#2
Merged
Conversation
…twork interface details Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-configendpoint 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
generateMetaDatafunction and related handlers were updated to fetch and include network interface details from SMD, and a helperbuildInterfacesArraywas added to combine NIC and interface data for template rendering. [1] [2] [3]New
/network-configendpoint:/network-configwas 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:
Documentation updates:
CLOUDINIT.mddocumentation was updated to describe the new network interface information in instance metadata and to document the/network-configendpoint, including example responses. [1] [2] [3]Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryType of Change
For more info, see Contributing Guidelines.