@@ -6,7 +6,7 @@ package v1alpha1
66import (
77 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
88
9- corev1 "github.com/ironcore-dev/network-operator/api/core/v1alpha1"
9+ "github.com/ironcore-dev/network-operator/api/core/v1alpha1"
1010)
1111
1212// VPCDomainSpec defines the desired state of a vPC domain (Virtual Port Channel Domain)
@@ -15,7 +15,7 @@ type VPCDomainSpec struct {
1515 // Immutable.
1616 // +required
1717 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="DeviceRef is immutable"
18- DeviceRef corev1 .LocalObjectReference `json:"deviceRef"`
18+ DeviceRef v1alpha1 .LocalObjectReference `json:"deviceRef"`
1919
2020 // DomainID is the vPC domain ID (1-1000).
2121 // This uniquely identifies the vPC domain and must match on both peer switches.
@@ -27,8 +27,9 @@ type VPCDomainSpec struct {
2727
2828 // AdminState is the administrative state of the vPC domain (enabled/disabled).
2929 // When disabled, the vPC domain is administratively shut down.
30- // +required
31- AdminState AdminState `json:"adminState"`
30+ // +optional
31+ // +kubebuilder:default=Up
32+ AdminState v1alpha1.AdminState `json:"adminState"`
3233
3334 // RolePriority is the role priority for this vPC domain (1-65535).
3435 // The switch with the lower role priority becomes the operational primary.
@@ -67,17 +68,6 @@ type VPCDomainSpec struct {
6768 Peer Peer `json:"peer"`
6869}
6970
70- // AdminState represents the administrative state of the peer-link connection (Up/Down).
71- // +kubebuilder:validation:Enum=Up;Down
72- type AdminState string
73-
74- const (
75- // AdminStateUp indicates the connection to the peer is administratively enabled.
76- AdminStateUp AdminState = "Up"
77- // AdminStateDown indicates the connection to the peer is administratively disabled.
78- AdminStateDown AdminState = "Down"
79- )
80-
8171// Enabled represents a simple enabled/disabled configuration.
8272type Enabled struct {
8373 // Enabled indicates whether a configuration property is administratively enabled (true) or disabled (false).
@@ -88,14 +78,15 @@ type Enabled struct {
8878// Peer defines settings to configure peer settings
8979type Peer struct {
9080 // AdminState defines the administrative state of the peer-link.
91- // +required
92- AdminState AdminState `json:"adminState"`
81+ // +optional
82+ // +kubebuilder:default=Up
83+ AdminState v1alpha1.AdminState `json:"adminState"`
9384
9485 // InterfaceRef is a reference to an Interface resource and identifies the interface to be used as the vPC domain's peer-link.
9586 // This interface carries control and data traffic between the two vPC domain peers.
9687 // It is usually dedicated port-channel, but it can also be a single physical interface.
9788 // +required
98- InterfaceRef corev1 .LocalObjectReference `json:"interfaceRef,omitempty"`
89+ InterfaceRef v1alpha1 .LocalObjectReference `json:"interfaceRef,omitempty"`
9990
10091 // KeepAlive defines the out-of-band keepalive configuration.
10192 // +required
@@ -145,7 +136,7 @@ type KeepAlive struct {
145136 // If specified, the switch sends keepalive packets throughout this VRF.
146137 // If omitted, the management VRF is used.
147138 // +optional
148- VRFRef * corev1 .LocalObjectReference `json:"vrfRef,omitempty"`
139+ VRFRef * v1alpha1 .LocalObjectReference `json:"vrfRef,omitempty"`
149140}
150141
151142// AutoRecovery holds settings to automatically restore vPC domain's operation after detecting
0 commit comments