@@ -45,20 +45,19 @@ type NodeNetworkConfigSpec struct {
4545 IPsNotInUse []string `json:"ipsNotInUse,omitempty"`
4646}
4747
48- // Mode is the type of Pod Subnet we are operating in
49- // +kubebuilder:validation:Enum=swift;overlay
50- type Mode string
48+ // Status indicates the NNC reconcile status
49+ // +kubebuilder:validation:Enum=Updating;Updated;Error
50+ type Status string
5151
5252const (
53- Overlay Mode = "overlay"
54- Swift Mode = "swift"
53+ Updating Status = "Updating"
54+ Updated Status = "Updated"
55+ Error Status = "Error"
5556)
5657
5758// NodeNetworkConfigStatus defines the observed state of NetworkConfig
5859type NodeNetworkConfigStatus struct {
59- AssignedIPCount int `json:"assignedIPCount,omitempty"`
60- // +kubebuilder:default=swift
61- Mode Mode `json:"mode,omitempty"`
60+ AssignedIPCount int `json:"assignedIPCount,omitempty"`
6261 Scaler Scaler `json:"scaler,omitempty"`
6362 Status Status `json:"status,omitempty"`
6463 NetworkContainers []NetworkContainer `json:"networkContainers,omitempty"`
@@ -72,19 +71,29 @@ type Scaler struct {
7271 MaxIPCount int64 `json:"maxIPCount,omitempty"`
7372}
7473
75- // Status indicates the NNC reconcile status
76- // +kubebuilder:validation:Enum=Updating;Updated;Error
77- type Status string
74+ // AssignmentMode is whether we are allocated an entire block or IP by IP.
75+ // +kubebuilder:validation:Enum=dynamic;static
76+ type AssignmentMode string
7877
7978const (
80- Updating Status = "Updating"
81- Updated Status = "Updated"
82- Error Status = "Error"
79+ Dynamic AssignmentMode = "dynamic"
80+ Static AssignmentMode = "static"
81+ )
82+
83+ // NCType is the specific type of network this NC represents.
84+ type NCType string
85+
86+ const (
87+ VNET NCType = "vnet"
88+ Overlay NCType = "overlay"
8389)
8490
8591// NetworkContainer defines the structure of a Network Container as found in NetworkConfigStatus
8692type NetworkContainer struct {
87- ID string `json:"id,omitempty"`
93+ ID string `json:"id,omitempty"`
94+ // +kubebuilder:default=dynamic
95+ AssignmentMode AssignmentMode `json:"assignmentMode,omitempty"`
96+ Type NCType `json:"type,omitempty"`
8897 PrimaryIP string `json:"primaryIP,omitempty"`
8998 SubnetName string `json:"subnetName,omitempty"`
9099 IPAssignments []IPAssignment `json:"ipAssignments,omitempty"`
0 commit comments