Add hostname propagation to ironcore-net NetworkInterfaces#681
Add hostname propagation to ironcore-net NetworkInterfaces#681ushabelgur wants to merge 2 commits intomainfrom
NetworkInterfaces#681Conversation
WalkthroughAdds a HostName field to NetworkInterfaceSpec, sets it to the machine ID during machine creation, and propagates it through the apinet plugin into the ironcore-net NetworkInterface spec. Also bumps the ironcore-net module version. Changes
Sequence DiagramsequenceDiagram
participant Client
participant MachineCreate as Machine Create Handler
participant APISpec as NetworkInterfaceSpec
participant APINETPlugin as APINet Plugin
participant IronNetAPI as IronCore-Net API
Client->>MachineCreate: Create Machine Request
MachineCreate->>APISpec: Construct NetworkInterfaceSpec
MachineCreate->>APISpec: Set HostName = Machine.ID
MachineCreate->>APINETPlugin: Create NetworkInterface with Spec
APINETPlugin->>APISpec: Read HostName from Spec
APINETPlugin->>IronNetAPI: Create NetworkInterface (includes Hostname)
IronNetAPI->>APINETPlugin: Confirm Creation
APINETPlugin->>MachineCreate: Return Result
MachineCreate->>Client: Machine Created
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b53f555 to
e41fa2f
Compare
072447e to
2474f40
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/server/machine_create.go (1)
57-67:⚠️ Potential issue | 🔴 Critical
HostNamefield will be empty string becauseiriMachine.Metadata.Idis not populated in requests.At line 64, the
HostNameis set toiriMachine.Metadata.Id, but the IRI request'sMetadataobject never includes anIdfield—it's only present in the response after being generated by the server. All test cases confirm that incomingMachine.Metadatacontains only labels, not an id.The PR objective states "Pass machineName as hostname," but the IRI
Machinerequest provides no machine name field. The available option in the request is theLabelsmap (which contains a UID label, not a human-readable name). The server's generated internal ID at line 71 comes too late and is not the IRI machine's identifier anyway.To fix this: determine whether to use a label value (if machine name is stored there), or reconsider the approach for obtaining the machine identifier at the point where
NetworkInterfaceSpecis created.

Proposed Changes
NetworkInterfaceswhile creating machineFixes #538
Summary by CodeRabbit
New Features
Dependencies