Skip to content

Commit e41fa2f

Browse files
committed
pass hostname to apinet nic
1 parent 171102e commit e41fa2f

6 files changed

Lines changed: 8 additions & 4 deletions

File tree

api/machine.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type Machine struct {
1818
}
1919

2020
type MachineSpec struct {
21+
Name string `json:"name"`
2122
Power PowerState `json:"power"`
2223

2324
Cpu int64 `json:"cpu"`

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/ironcore-dev/controller-utils v0.10.0
1212
github.com/ironcore-dev/ironcore v0.2.5-0.20251024123813-eecafba97af9
1313
github.com/ironcore-dev/ironcore-image v0.2.5
14-
github.com/ironcore-dev/ironcore-net v0.2.4
14+
github.com/ironcore-dev/ironcore-net v0.2.5-0.20260123094402-a0b32fb0e8ff
1515
github.com/ironcore-dev/provider-utils v0.0.0-20251010114402-394db8015df4
1616
github.com/moby/term v0.5.2
1717
github.com/onsi/ginkgo/v2 v2.27.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ github.com/ironcore-dev/ironcore v0.2.5-0.20251024123813-eecafba97af9 h1:QQfXQO7
167167
github.com/ironcore-dev/ironcore v0.2.5-0.20251024123813-eecafba97af9/go.mod h1:9ATw2BEKZSdtUtNK9sAd+GLrcoxF2iF4Q6S67KqfKow=
168168
github.com/ironcore-dev/ironcore-image v0.2.5 h1:ImJD3B1p1/JVs5vx7YB3c8dwH/EHyWOcgWUqhTUmsR0=
169169
github.com/ironcore-dev/ironcore-image v0.2.5/go.mod h1:pQLc+7dzgjYORTpEM9ORM757Vm14EQRju9hsvR8VT/U=
170-
github.com/ironcore-dev/ironcore-net v0.2.4 h1:r2SqxwStws86KBvxJcK/myRxb946qAZVpPKd1rJzfsQ=
171-
github.com/ironcore-dev/ironcore-net v0.2.4/go.mod h1:dSn6aWF+bxCIeWJzPjDl5dVTH3Rd7wx1LuTQpYUU4Lg=
170+
github.com/ironcore-dev/ironcore-net v0.2.5-0.20260123094402-a0b32fb0e8ff h1:tUnwPIllqJSMc581PIul0kH500EzMJoks1xB7zlie9o=
171+
github.com/ironcore-dev/ironcore-net v0.2.5-0.20260123094402-a0b32fb0e8ff/go.mod h1:jy3F6vLjt+2JMXi39P6NklJ66hJjf12BYEC7eOIy7IA=
172172
github.com/ironcore-dev/provider-utils v0.0.0-20251010114402-394db8015df4 h1:sRQ/gcL5z3CqcqI+9If8XmgVk9pK4WebZOAMNFYXREQ=
173173
github.com/ironcore-dev/provider-utils v0.0.0-20251010114402-394db8015df4/go.mod h1:qxuFuJy31Lfu3go5wsGpFGAZwCw1++1EKGJmHG2HbLw=
174174
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=

internal/plugins/networkinterface/apinet/apinet.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ func (p *Plugin) Apply(ctx context.Context, spec *api.NetworkInterfaceSpec, mach
145145
NodeRef: corev1.LocalObjectReference{
146146
Name: p.nodeName,
147147
},
148-
IPs: ironcoreIPsToAPInetIPs(spec.Ips),
148+
IPs: ironcoreIPsToAPInetIPs(spec.Ips),
149+
Hostname: machine.Spec.Name,
149150
},
150151
}
151152

internal/server/machine_create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func (s *Server) createMachineFromIRIMachine(ctx context.Context, log logr.Logge
7070
ID: s.idGen.Generate(),
7171
},
7272
Spec: api.MachineSpec{
73+
Name: iriMachine.Metadata.Id,
7374
Power: power,
7475
Cpu: cpu,
7576
MemoryBytes: memory,

internal/server/machine_create_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var _ = Describe("CreateMachine", func() {
1717
createResp, err := machineClient.CreateMachine(ctx, &iri.CreateMachineRequest{
1818
Machine: &iri.Machine{
1919
Metadata: &irimeta.ObjectMetadata{
20+
Id: "machine1",
2021
Labels: map[string]string{
2122
"machinepoolletv1alpha1.MachineUIDLabel": "foobar",
2223
},

0 commit comments

Comments
 (0)