From 2863264c09d78d29a40523535fcaf7c0945e2579 Mon Sep 17 00:00:00 2001 From: Matthew Long <61910737+thatmattlong@users.noreply.github.com> Date: Wed, 12 Aug 2020 12:49:43 -0700 Subject: [PATCH] feat: include subnet address space in CRD BREAKING CHANGE: removes `Netmask` from NNC Status because it is now redundant --- .../kubecontroller/crdtranslator_test.go | 8 ++++---- nodenetworkconfig/api/v1alpha/nodenetworkconfig.go | 13 ++++++------- .../manifests/acn.azure.com_nodenetworkconfigs.yaml | 7 +++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/cns/requestcontroller/kubecontroller/crdtranslator_test.go b/cns/requestcontroller/kubecontroller/crdtranslator_test.go index 6e16fc2503..6525b798f3 100644 --- a/cns/requestcontroller/kubecontroller/crdtranslator_test.go +++ b/cns/requestcontroller/kubecontroller/crdtranslator_test.go @@ -15,7 +15,7 @@ const ( ipNotCIDR = "10.0.0.1" ipMalformed = "10.0.0.0.0" defaultGateway = "10.0.0.2" - subnetID = "subnet1" + subnetName = "subnet1" ) func TestStatusToNCRequestMalformedPrimaryIP(t *testing.T) { @@ -155,9 +155,9 @@ func TestStatusToNCRequestSuccess(t *testing.T) { IP: ipCIDR, }, }, - SubnetID: subnetID, - DefaultGateway: defaultGateway, - Netmask: "", // Not currently set by DNC Request Controller + SubnetName: subnetName, + DefaultGateway: defaultGateway, + SubnetAddressSpace: "", // Not currently set by DNC Request Controller }, }, } diff --git a/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go b/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go index c46a645e47..7b36b90d36 100644 --- a/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go +++ b/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go @@ -66,13 +66,12 @@ type Scaler struct { // NetworkContainer defines the structure of a Network Container as found in NetworkConfigStatus type NetworkContainer struct { - ID string `json:"id,omitempty"` - PrimaryIP string `json:"primaryIP,omitempty"` - SubnetID string `json:"subnetID,omitempty"` - IPAssignments []IPAssignment `json:"iPAssignments,omitempty"` - DefaultGateway string `json:"defaultGateway,omitempty"` - // Netmask for the subnet represented by this NC's SubnetID - Netmask string `json:"netmask,omitempty"` + ID string `json:"id,omitempty"` + PrimaryIP string `json:"primaryIP,omitempty"` + SubnetName string `json:"subnetName,omitempty"` + IPAssignments []IPAssignment `json:"iPAssignments,omitempty"` + DefaultGateway string `json:"defaultGateway,omitempty"` + SubnetAddressSpace string `json:"subnetAddressSpace,omitempty"` } // IPAssignment groups an IP address and Name. Name is a UUID set by the the IP address assigner. diff --git a/nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml b/nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml index 879b61e0c1..908ad98d49 100644 --- a/nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml +++ b/nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml @@ -69,12 +69,11 @@ spec: type: array id: type: string - netmask: - description: Netmask for the subnet represented by this NC's SubnetID - type: string primaryIP: type: string - subnetID: + subnetAddressSpace: + type: string + subnetName: type: string type: object type: array