Skip to content

Add hostname propagation to ironcore-net NetworkInterfaces - #681

Merged
lukasfrank merged 6 commits into
mainfrom
enh/hostname
Jun 8, 2026
Merged

lukasfrank merged 6 commits into
mainfrom
enh/hostname

Conversation

@ushabelgur

@ushabelgur ushabelgur commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Pass machineName as hostaname to ironcore-net NetworkInterfaces while creating machine
  • Update testcase
  • Update ironcore-net dependency

Fixes #538

Summary by CodeRabbit

  • New Features

    • Machines can include an optional guest configuration with a hostname; network interfaces now receive and use hostnames from machine guest config to improve identification.
  • Chores

    • Bumped Go toolchain and dependency versions and updated pinned tooling versions used for code generation and tests.

Review Change Stack

@coderabbitai

coderabbitai Bot commented Jan 28, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a MachineGuestConfig with HostName, populates it during machine creation, includes Hostname in APInet NetworkInterface apply, and updates Go/Kubernetes dependencies and pinned tool versions.

Changes

Hostname propagation

Layer / File(s) Summary
API type and machine creation
api/machine.go, internal/server/machine_create.go
Adds MachineGuestConfig (HostName JSON hostName,omitempty) to MachineSpec and sets api.MachineSpec.GuestConfig from iriMachine.Spec.GuestConfig.Hostname when creating machines.
APInet plugin apply
internal/plugins/networkinterface/apinet/apinet.go
APInet apply-configuration builder now includes Hostname from machine.Spec.GuestConfig.HostName, uses apinetClient.Apply(...), then retrieves the applied NetworkInterface with Get(...) before computing host device/direct wiring.
Dependency upgrades (go.mod)
go.mod
Bump go directive and multiple direct/indirect dependencies including github.com/ironcore-dev/ironcore and k8s.io/* / sigs.k8s.io/controller-runtime versions.
Pinned tool versions
Makefile
Update CONTROLLER_TOOLS_VERSION and ENVTEST_VERSION defaults used for codegen and envtest downloads.

Sequence Diagram

sequenceDiagram
    participant Client
    participant MachineCreate as Machine Create
    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 (from GuestConfig.Hostname)
    MachineCreate->>APINETPlugin: Request NIC creation with Spec
    APINETPlugin->>APISpec: Read HostName from Spec
    APINETPlugin->>IronNetAPI: Apply NetworkInterface (includes Hostname)
    IronNetAPI->>APINETPlugin: Return applied NetworkInterface
    APINETPlugin->>IronNetAPI: Get applied NetworkInterface
    APINETPlugin->>MachineCreate: Return result
    MachineCreate->>Client: Respond Machine created
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding hostname propagation to ironcore-net NetworkInterfaces, which is the primary objective of the PR.
Description check ✅ Passed The description covers the key changes (hostname propagation, test updates, dependency updates) and references the linked issue #538, following the template structure.
Linked Issues check ✅ Passed The PR satisfies issue #538 requirements: adds hostname field to ironcore-net NetworkInterface via MachineGuestConfig, implements hostname propagation in the apinet plugin, and updates dependencies.
Out of Scope Changes check ✅ Passed All changes are directly related to hostname propagation: API types for guest config, apinet plugin implementation, machine creation logic, and dependency/tool version updates. No unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enh/hostname

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added enhancement New feature or request size/S labels Jan 28, 2026
@ushabelgur ushabelgur self-assigned this Jan 28, 2026
@ushabelgur ushabelgur added the integration-tests to run integration tests label Jan 28, 2026
@ushabelgur
ushabelgur force-pushed the enh/hostname branch 2 times, most recently from b53f555 to e41fa2f Compare January 28, 2026 06:32
@hardikdr hardikdr added this to Roadmap Jan 28, 2026
@ushabelgur
ushabelgur marked this pull request as ready for review January 28, 2026 08:10
@ushabelgur
ushabelgur requested a review from a team January 28, 2026 08:10
Comment thread api/machine.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

HostName field will be empty string because iriMachine.Metadata.Id is not populated in requests.

At line 64, the HostName is set to iriMachine.Metadata.Id, but the IRI request's Metadata object never includes an Id field—it's only present in the response after being generated by the server. All test cases confirm that incoming Machine.Metadata contains only labels, not an id.

The PR objective states "Pass machineName as hostname," but the IRI Machine request provides no machine name field. The available option in the request is the Labels map (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 NetworkInterfaceSpec is created.

@afritzler

Copy link
Copy Markdown
Member
Screenshot 2026-02-09 at 10 11 34

@ushabelgur
ushabelgur marked this pull request as draft February 9, 2026 09:13
@afritzler

Copy link
Copy Markdown
Member

/ref ironcore-dev/ironcore#1454

@github-actions github-actions Bot added size/XS and removed size/S labels May 12, 2026
@github-actions github-actions Bot added size/L and removed size/XS labels May 12, 2026
@ushabelgur
ushabelgur marked this pull request as ready for review May 14, 2026 09:30
Comment thread api/machine.go Outdated
Signed-off-by: ushabelgur <usha.belgur@t-systems.com>
Signed-off-by: ushabelgur <usha.belgur@t-systems.com>
Signed-off-by: ushabelgur <usha.belgur@t-systems.com>
Signed-off-by: ushabelgur <usha.belgur@t-systems.com>
Signed-off-by: ushabelgur <usha.belgur@t-systems.com>
Signed-off-by: ushabelgur <usha.belgur@t-systems.com>
@ushabelgur
ushabelgur requested a review from friegger May 28, 2026 08:02
Comment thread internal/plugins/networkinterface/apinet/apinet.go
@ushabelgur
ushabelgur requested a review from lukasfrank May 29, 2026 10:14
@lukasfrank
lukasfrank merged commit 32a4489 into main Jun 8, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Roadmap Jun 8, 2026
@lukasfrank
lukasfrank deleted the enh/hostname branch June 8, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compute enhancement New feature or request integration-tests to run integration tests size/L

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add hostname propagation to ironcore-net NetworkInterfaces

5 participants