Skip to content

Commit d2958f6

Browse files
committed
feat(api): add GroupCIDR type and ImpNetworkStatus.GroupCIDRs field
1 parent 418d053 commit d2958f6

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

api/v1alpha1/impnetwork_types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ type NetworkGroupSpec struct {
107107
ExpectedSize int32 `json:"expectedSize,omitempty"`
108108
}
109109

110+
// GroupCIDR records the subnet CIDR allocated to a named network group.
111+
type GroupCIDR struct {
112+
// Name is the group name (matches spec.groups[].name).
113+
Name string `json:"name"`
114+
// CIDR is the subnet allocated for this group (e.g. "10.44.0.0/28").
115+
CIDR string `json:"cidr"`
116+
}
117+
110118
// VTEPEntry maps a VM's IP and MAC to the node IP that hosts it.
111119
// Used by the VXLAN FDB to route cross-node VM traffic.
112120
type VTEPEntry struct {
@@ -136,6 +144,13 @@ type ImpNetworkStatus struct {
136144
// +listType=map
137145
// +listMapKey=vmIP
138146
VTEPTable []VTEPEntry `json:"vtepTable,omitempty"`
147+
148+
// GroupCIDRs contains the allocated subnet CIDR for each network group in spec.groups.
149+
// Populated and maintained by the controller; do not edit manually.
150+
// +optional
151+
// +listType=map
152+
// +listMapKey=name
153+
GroupCIDRs []GroupCIDR `json:"groupCIDRs,omitempty"`
139154
}
140155

141156
// +kubebuilder:object:root=true

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/imp.dev_impnetworks.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,29 @@ spec:
238238
x-kubernetes-list-map-keys:
239239
- type
240240
x-kubernetes-list-type: map
241+
groupCIDRs:
242+
description: |-
243+
GroupCIDRs contains the allocated subnet CIDR for each network group in spec.groups.
244+
Populated and maintained by the controller; do not edit manually.
245+
items:
246+
description: GroupCIDR records the subnet CIDR allocated to a named
247+
network group.
248+
properties:
249+
cidr:
250+
description: CIDR is the subnet allocated for this group (e.g.
251+
"10.44.0.0/28").
252+
type: string
253+
name:
254+
description: Name is the group name (matches spec.groups[].name).
255+
type: string
256+
required:
257+
- cidr
258+
- name
259+
type: object
260+
type: array
261+
x-kubernetes-list-map-keys:
262+
- name
263+
x-kubernetes-list-type: map
241264
vtepTable:
242265
description: |-
243266
VTEPTable contains VTEP entries for cross-node VXLAN FDB population.

0 commit comments

Comments
 (0)