Skip to content

Commit 81194c2

Browse files
authored
feat: include subnet address space in CRD (#647)
BREAKING CHANGE: removes `Netmask` from NNC Status because it is now redundant
1 parent 72dd4a2 commit 81194c2

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

cns/requestcontroller/kubecontroller/crdtranslator_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
ipNotCIDR = "10.0.0.1"
1616
ipMalformed = "10.0.0.0.0"
1717
defaultGateway = "10.0.0.2"
18-
subnetID = "subnet1"
18+
subnetName = "subnet1"
1919
)
2020

2121
func TestStatusToNCRequestMalformedPrimaryIP(t *testing.T) {
@@ -155,9 +155,9 @@ func TestStatusToNCRequestSuccess(t *testing.T) {
155155
IP: ipCIDR,
156156
},
157157
},
158-
SubnetID: subnetID,
159-
DefaultGateway: defaultGateway,
160-
Netmask: "", // Not currently set by DNC Request Controller
158+
SubnetName: subnetName,
159+
DefaultGateway: defaultGateway,
160+
SubnetAddressSpace: "", // Not currently set by DNC Request Controller
161161
},
162162
},
163163
}

nodenetworkconfig/api/v1alpha/nodenetworkconfig.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,12 @@ type Scaler struct {
6666

6767
// NetworkContainer defines the structure of a Network Container as found in NetworkConfigStatus
6868
type NetworkContainer struct {
69-
ID string `json:"id,omitempty"`
70-
PrimaryIP string `json:"primaryIP,omitempty"`
71-
SubnetID string `json:"subnetID,omitempty"`
72-
IPAssignments []IPAssignment `json:"iPAssignments,omitempty"`
73-
DefaultGateway string `json:"defaultGateway,omitempty"`
74-
// Netmask for the subnet represented by this NC's SubnetID
75-
Netmask string `json:"netmask,omitempty"`
69+
ID string `json:"id,omitempty"`
70+
PrimaryIP string `json:"primaryIP,omitempty"`
71+
SubnetName string `json:"subnetName,omitempty"`
72+
IPAssignments []IPAssignment `json:"iPAssignments,omitempty"`
73+
DefaultGateway string `json:"defaultGateway,omitempty"`
74+
SubnetAddressSpace string `json:"subnetAddressSpace,omitempty"`
7675
}
7776

7877
// IPAssignment groups an IP address and Name. Name is a UUID set by the the IP address assigner.

nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ spec:
6969
type: array
7070
id:
7171
type: string
72-
netmask:
73-
description: Netmask for the subnet represented by this NC's SubnetID
74-
type: string
7572
primaryIP:
7673
type: string
77-
subnetID:
74+
subnetAddressSpace:
75+
type: string
76+
subnetName:
7877
type: string
7978
type: object
8079
type: array

0 commit comments

Comments
 (0)