Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
)

// IP is an IP address.
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=ip
type IP struct {
netip.Addr `json:"-"`
}
Expand Down
40 changes: 34 additions & 6 deletions api/v1alpha1/server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,44 @@ type NetworkInterface struct {
// +required
Name string `json:"name"`

// IP is the IP address assigned to the network interface.
// The type is specified as string and is schemaless.
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Schemaless
// +required
IP IP `json:"ip"`
// IPs is a list of IP addresses (both IPv4 and IPv6) assigned to the network interface.
// +optional
IPs []IP `json:"ips,omitempty"`

// MACAddress is the MAC address of the network interface.
// +required
MACAddress string `json:"macAddress"`

// CarrierStatus is the operational carrier status of the network interface.
// +optional
CarrierStatus string `json:"carrierStatus,omitempty"`

// Neighbors contains the LLDP neighbors discovered on this interface.
// +optional
Neighbors []LLDPNeighbor `json:"neighbors,omitempty"`
}

// LLDPNeighbor defines the details of an LLDP neighbor.
type LLDPNeighbor struct {
// MACAddress is the MAC address of the LLDP neighbor.
// +optional
MACAddress string `json:"macAddress,omitempty"`

// PortID is the port identifier of the LLDP neighbor.
// +optional
PortID string `json:"portID,omitempty"`

// PortDescription is the port description of the LLDP neighbor.
// +optional
PortDescription string `json:"portDescription,omitempty"`

// SystemName is the system name of the LLDP neighbor.
// +optional
SystemName string `json:"systemName,omitempty"`

// SystemDescription is the system description of the LLDP neighbor.
// +optional
SystemDescription string `json:"systemDescription,omitempty"`
}

// StorageDrive defines the details of one storage drive
Expand Down
28 changes: 27 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bmc/redfish_kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (r *RedfishKubeBMC) SetPXEBootOnce(ctx context.Context, systemURI string) e
if err := system.SetBoot(setBoot); err != nil {
return fmt.Errorf("failed to set the boot order: %w", err)
}
netData := `{"networkInterfaces":[{"name":"dummy0","ipAddress":"127.0.0.2","macAddress":"aa:bb:cc:dd:ee:ff"}]`
netData := `{"networkInterfaces":[{"name":"dummy0","ipAddresses":["127.0.0.2"],"macAddress":"aa:bb:cc:dd:ee:ff"}]`
curlCmd := fmt.Sprintf(
`apk add curl && curl -H 'Content-Type: application/json' \
-d '{"SystemUUID":"%s","data":%s}}' \
Expand Down
43 changes: 38 additions & 5 deletions config/crd/bases/metal.ironcore.dev_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,19 +461,52 @@ spec:
items:
description: NetworkInterface defines the details of a network interface.
properties:
ip:
description: |-
IP is the IP address assigned to the network interface.
The type is specified as string and is schemaless.
carrierStatus:
description: CarrierStatus is the operational carrier status
of the network interface.
type: string
ips:
description: IPs is a list of IP addresses (both IPv4 and IPv6)
assigned to the network interface.
items:
format: ip
type: string
type: array
macAddress:
description: MACAddress is the MAC address of the network interface.
type: string
name:
description: Name is the name of the network interface.
type: string
neighbors:
description: Neighbors contains the LLDP neighbors discovered
on this interface.
items:
description: LLDPNeighbor defines the details of an LLDP neighbor.
properties:
macAddress:
description: MACAddress is the MAC address of the LLDP
neighbor.
type: string
portDescription:
description: PortDescription is the port description of
the LLDP neighbor.
type: string
portID:
description: PortID is the port identifier of the LLDP
neighbor.
type: string
systemDescription:
description: SystemDescription is the system description
of the LLDP neighbor.
type: string
systemName:
description: SystemName is the system name of the LLDP
neighbor.
type: string
type: object
type: array
required:
- ip
- macAddress
- name
type: object
Expand Down
43 changes: 38 additions & 5 deletions dist/chart/templates/crd/metal.ironcore.dev_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,52 @@ spec:
items:
description: NetworkInterface defines the details of a network interface.
properties:
ip:
description: |-
IP is the IP address assigned to the network interface.
The type is specified as string and is schemaless.
carrierStatus:
description: CarrierStatus is the operational carrier status
of the network interface.
type: string
ips:
description: IPs is a list of IP addresses (both IPv4 and IPv6)
assigned to the network interface.
items:
format: ip
type: string
type: array
macAddress:
description: MACAddress is the MAC address of the network interface.
type: string
name:
description: Name is the name of the network interface.
type: string
neighbors:
description: Neighbors contains the LLDP neighbors discovered
on this interface.
items:
description: LLDPNeighbor defines the details of an LLDP neighbor.
properties:
macAddress:
description: MACAddress is the MAC address of the LLDP
neighbor.
type: string
portDescription:
description: PortDescription is the port description of
the LLDP neighbor.
type: string
portID:
description: PortID is the port identifier of the LLDP
neighbor.
type: string
systemDescription:
description: SystemDescription is the system description
of the LLDP neighbor.
type: string
systemName:
description: SystemName is the system name of the LLDP
neighbor.
type: string
type: object
type: array
required:
- ip
- macAddress
- name
type: object
Expand Down
112 changes: 108 additions & 4 deletions docs/api-reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3037,6 +3037,84 @@ IP
</tr>
</tbody>
</table>
<h3 id="metal.ironcore.dev/v1alpha1.LLDPNeighbor">LLDPNeighbor
</h3>
<p>
(<em>Appears on:</em><a href="#metal.ironcore.dev/v1alpha1.NetworkInterface">NetworkInterface</a>)
</p>
<div>
<p>LLDPNeighbor defines the details of an LLDP neighbor.</p>
</div>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>macAddress</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>MACAddress is the MAC address of the LLDP neighbor.</p>
</td>
</tr>
<tr>
<td>
<code>portID</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>PortID is the port identifier of the LLDP neighbor.</p>
</td>
</tr>
<tr>
<td>
<code>portDescription</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>PortDescription is the port description of the LLDP neighbor.</p>
</td>
</tr>
<tr>
<td>
<code>systemName</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>SystemName is the system name of the LLDP neighbor.</p>
</td>
</tr>
<tr>
<td>
<code>systemDescription</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>SystemDescription is the system description of the LLDP neighbor.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="metal.ironcore.dev/v1alpha1.NetworkInterface">NetworkInterface
</h3>
<p>
Expand Down Expand Up @@ -3066,16 +3144,16 @@ string
</tr>
<tr>
<td>
<code>ip</code><br/>
<code>ips</code><br/>
<em>
<a href="#metal.ironcore.dev/v1alpha1.IP">
IP
[]IP
</a>
</em>
</td>
<td>
<p>IP is the IP address assigned to the network interface.
The type is specified as string and is schemaless.</p>
<em>(Optional)</em>
<p>IPs is a list of IP addresses (both IPv4 and IPv6) assigned to the network interface.</p>
</td>
</tr>
<tr>
Expand All @@ -3089,6 +3167,32 @@ string
<p>MACAddress is the MAC address of the network interface.</p>
</td>
</tr>
<tr>
<td>
<code>carrierStatus</code><br/>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>CarrierStatus is the operational carrier status of the network interface.</p>
</td>
</tr>
<tr>
<td>
<code>neighbors</code><br/>
<em>
<a href="#metal.ironcore.dev/v1alpha1.LLDPNeighbor">
[]LLDPNeighbor
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Neighbors contains the LLDP neighbors discovered on this interface.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="metal.ironcore.dev/v1alpha1.Phase">Phase
Expand Down
Loading
Loading