Skip to content

Commit b41ada3

Browse files
committed
feat: add fields in pod network crd for prefix block mode for swiftv2
1 parent bd7e2ae commit b41ada3

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

crd/multitenancy/api/v1alpha1/podnetwork.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ const (
4545
DeviceTypeInfiniBandNIC DeviceType = "acn.azure.com/infiniband-nic"
4646
)
4747

48+
// +kubebuilder:validation:Enum=Single;PrefixBlock
49+
type SubnetAllocationMode string
50+
51+
const (
52+
Single SubnetAllocationMode = "Single"
53+
PrefixBlock SubnetAllocationMode = "PrefixBlock"
54+
)
55+
4856
// PodNetworkSpec defines the desired state of PodNetwork
4957
type PodNetworkSpec struct {
5058
// NetworkID is the identifier for the network, e.g. vnet guid or IB network ID
@@ -62,6 +70,10 @@ type PodNetworkSpec struct {
6270
// Deprecated - Use NetworkID
6371
// +kubebuilder:validation:Optional
6472
VnetGUID string `json:"vnetGUID,omitempty"`
73+
// subnet allocation mode
74+
// +kubebuilder:validation:Optional
75+
// +kubebuilder:default=Single
76+
SubnetAllocationMode SubnetAllocationMode `json:"subnetAllocationMode,omitempty"`
6577
}
6678

6779
// Status indicates the status of PN
@@ -80,6 +92,9 @@ type PodNetworkStatus struct {
8092
// +kubebuilder:validation:Optional
8193
Status Status `json:"status,omitempty"`
8294
AddressPrefixes []string `json:"addressPrefixes,omitempty"`
95+
// PrefixBlockAllocationSize indicates the size of IP block allocated to the subnet
96+
// +kubebuilder:default=16
97+
PrefixBlockAllocationSize int `json:"prefixBlockAllocationSize,omitempty"`
8398
}
8499

85100
func init() {

crd/multitenancy/manifests/multitenancy.acn.azure.com_podnetworks.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ spec:
7777
description: NetworkID is the identifier for the network, e.g. vnet
7878
guid or IB network ID
7979
type: string
80+
subnetAllocationMode:
81+
default: Single
82+
description: subnet allocation mode
83+
enum:
84+
- Single
85+
- PrefixBlock
86+
type: string
8087
subnetGUID:
8188
description: customer subnet guid
8289
type: string
@@ -94,6 +101,11 @@ spec:
94101
items:
95102
type: string
96103
type: array
104+
prefixBlockAllocationSize:
105+
default: 16
106+
description: PrefixBlockAllocationSize indicates the size of IP block
107+
allocated to the subnet
108+
type: integer
97109
status:
98110
description: Status indicates the status of PN
99111
enum:

0 commit comments

Comments
 (0)