Skip to content

Commit bb33fe0

Browse files
committed
api: update networkInterfaces, add Lldp
1 parent 6763faa commit bb33fe0

File tree

4 files changed

+184
-4
lines changed

4 files changed

+184
-4
lines changed

api/v1alpha1/common_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
)
1313

1414
// IP is an IP address.
15+
// +kubebuilder:validation:Type=string
16+
// +kubebuilder:validation:Format=ip
1517
type IP struct {
1618
netip.Addr `json:"-"`
1719
}

api/v1alpha1/server_types.go

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ type ServerStatus struct {
232232
// +optional
233233
Storages []Storage `json:"storages,omitempty"`
234234

235+
// LLDPInterfaces is a list of LLDP-enabled network interfaces with their neighbors.
236+
// +optional
237+
LLDPInterfaces []LLDPInterface `json:"lldpInterfaces,omitempty"`
238+
235239
// Conditions represents the latest available observations of the server's current state.
236240
// +patchStrategy=merge
237241
// +patchMergeKey=type
@@ -288,12 +292,66 @@ type NetworkInterface struct {
288292
// The type is specified as string and is schemaless.
289293
// +kubebuilder:validation:Type=string
290294
// +kubebuilder:validation:Schemaless
291-
// +required
292-
IP IP `json:"ip"`
295+
// +optional
296+
IP *IP `json:"ip,omitempty"`
297+
298+
// IPv6 is an array of IPv6 addresses assigned to the network interface.
299+
// +optional
300+
IPv6 []IP `json:"ipv6,omitempty"`
293301

294302
// MACAddress is the MAC address of the network interface.
295303
// +required
296304
MACAddress string `json:"macAddress"`
305+
306+
// Status is the operational status of the network interface.
307+
// +optional
308+
Status string `json:"status,omitempty"`
309+
}
310+
311+
// LLDPNeighbor defines the details of an LLDP neighbor.
312+
type LLDPNeighbor struct {
313+
// MACAddress is the MAC address of the LLDP neighbor.
314+
// +optional
315+
MACAddress string `json:"macAddress,omitempty"`
316+
317+
// PortID is the port identifier of the LLDP neighbor.
318+
// +optional
319+
PortID string `json:"portID,omitempty"`
320+
321+
// PortDescription is the port description of the LLDP neighbor.
322+
// +optional
323+
PortDescription string `json:"portDescription,omitempty"`
324+
325+
// SystemName is the system name of the LLDP neighbor.
326+
// +optional
327+
SystemName string `json:"systemName,omitempty"`
328+
329+
// SystemDescription is the system description of the LLDP neighbor.
330+
// +optional
331+
SystemDescription string `json:"systemDescription,omitempty"`
332+
333+
// EnabledCapabilities represents the enabled capabilities of the LLDP neighbor.
334+
// +optional
335+
EnabledCapabilities int `json:"enabledCapabilities,omitempty"`
336+
}
337+
338+
// LLDPInterface defines the details of an LLDP-enabled network interface.
339+
type LLDPInterface struct {
340+
// InterfaceIndex is the index of the network interface.
341+
// +optional
342+
InterfaceIndex int `json:"interfaceIndex,omitempty"`
343+
344+
// InterfaceName is the name of the network interface.
345+
// +optional
346+
InterfaceName string `json:"interfaceName,omitempty"`
347+
348+
// InterfaceAlternativeNames contains alternative names for the interface.
349+
// +optional
350+
InterfaceAlternativeNames []string `json:"interfaceAlternativeNames,omitempty"`
351+
352+
// Neighbors contains the LLDP neighbors discovered on this interface.
353+
// +optional
354+
Neighbors []LLDPNeighbor `json:"neighbors,omitempty"`
297355
}
298356

299357
// StorageDrive defines the details of one storage drive

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 58 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/metal.ironcore.dev_servers.yaml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,59 @@ spec:
446446
description: IndicatorLED specifies the current state of the server's
447447
indicator LED.
448448
type: string
449+
lldpInterfaces:
450+
description: LLDPInterfaces is a list of LLDP-enabled network interfaces
451+
with their neighbors.
452+
items:
453+
description: LLDPInterface defines the details of an LLDP-enabled
454+
network interface.
455+
properties:
456+
interfaceAlternativeNames:
457+
description: InterfaceAlternativeNames contains alternative
458+
names for the interface.
459+
items:
460+
type: string
461+
type: array
462+
interfaceIndex:
463+
description: InterfaceIndex is the index of the network interface.
464+
type: integer
465+
interfaceName:
466+
description: InterfaceName is the name of the network interface.
467+
type: string
468+
neighbors:
469+
description: Neighbors contains the LLDP neighbors discovered
470+
on this interface.
471+
items:
472+
description: LLDPNeighbor defines the details of an LLDP neighbor.
473+
properties:
474+
enabledCapabilities:
475+
description: EnabledCapabilities represents the enabled
476+
capabilities of the LLDP neighbor.
477+
type: integer
478+
macAddress:
479+
description: MACAddress is the MAC address of the LLDP
480+
neighbor.
481+
type: string
482+
portDescription:
483+
description: PortDescription is the port description of
484+
the LLDP neighbor.
485+
type: string
486+
portID:
487+
description: PortID is the port identifier of the LLDP
488+
neighbor.
489+
type: string
490+
systemDescription:
491+
description: SystemDescription is the system description
492+
of the LLDP neighbor.
493+
type: string
494+
systemName:
495+
description: SystemName is the system name of the LLDP
496+
neighbor.
497+
type: string
498+
type: object
499+
type: array
500+
type: object
501+
type: array
449502
manufacturer:
450503
description: Manufacturer is the name of the server manufacturer.
451504
type: string
@@ -463,14 +516,24 @@ spec:
463516
IP is the IP address assigned to the network interface.
464517
The type is specified as string and is schemaless.
465518
type: string
519+
ipv6:
520+
description: IPv6 is an array of IPv6 addresses assigned to
521+
the network interface.
522+
items:
523+
format: ip
524+
type: string
525+
type: array
466526
macAddress:
467527
description: MACAddress is the MAC address of the network interface.
468528
type: string
469529
name:
470530
description: Name is the name of the network interface.
471531
type: string
532+
status:
533+
description: Status is the operational status of the network
534+
interface.
535+
type: string
472536
required:
473-
- ip
474537
- macAddress
475538
- name
476539
type: object

0 commit comments

Comments
 (0)