Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
41 changes: 38 additions & 3 deletions api/v1alpha1/server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,50 @@ type NetworkInterface struct {
Name string `json:"name"`

// IP is the IP address assigned to the network interface.
// The type is specified as string and is schemaless.
// Deprecated: Use IPs instead. Kept for backward compatibility, always nil.
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Schemaless
// +required
IP IP `json:"ip"`
// +optional
IP *IP `json:"ip,omitempty"`

// 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
32 changes: 31 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
42 changes: 40 additions & 2 deletions config/crd/bases/metal.ironcore.dev_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,19 +461,57 @@ spec:
items:
description: NetworkInterface defines the details of a network interface.
properties:
carrierStatus:
description: CarrierStatus is the operational carrier status
of the network interface.
type: string
ip:
description: |-
IP is the IP address assigned to the network interface.
The type is specified as string and is schemaless.
Deprecated: Use IPs instead. Kept for backward compatibility, always nil.
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
42 changes: 40 additions & 2 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,57 @@ spec:
items:
description: NetworkInterface defines the details of a network interface.
properties:
carrierStatus:
description: CarrierStatus is the operational carrier status
of the network interface.
type: string
ip:
description: |-
IP is the IP address assigned to the network interface.
The type is specified as string and is schemaless.
Deprecated: Use IPs instead. Kept for backward compatibility, always nil.
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
121 changes: 120 additions & 1 deletion 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 @@ -3074,8 +3152,23 @@ IP
</em>
</td>
<td>
<em>(Optional)</em>
<p>IP is the IP address assigned to the network interface.
The type is specified as string and is schemaless.</p>
Deprecated: Use IPs instead. Kept for backward compatibility, always nil.</p>
</td>
</tr>
<tr>
<td>
<code>ips</code><br/>
<em>
<a href="#metal.ironcore.dev/v1alpha1.IP">
[]IP
</a>
</em>
</td>
<td>
<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 +3182,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