From 153886c9443d34e1d10db5de1c5be1933df24666 Mon Sep 17 00:00:00 2001 From: Matthew Long Date: Tue, 3 Nov 2020 13:19:57 -0800 Subject: [PATCH 1/4] update cns tag in yaml --- cns/azure-cns.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cns/azure-cns.yaml b/cns/azure-cns.yaml index ae64643433..e87dd53595 100644 --- a/cns/azure-cns.yaml +++ b/cns/azure-cns.yaml @@ -93,7 +93,7 @@ spec: effect: NoSchedule containers: - name: cns-container - image: mcr.microsoft.com/containernetworking/azure-cns:v1.1.9-alpha + image: mcr.microsoft.com/containernetworking/azure-cns:v1.2.0-alpha imagePullPolicy: IfNotPresent args: [ "-c", "tcp://$(CNSIpAddress):$(CNSPort)", "-t", "$(CNSLogTarget)"] volumeMounts: From fa1edfd3cc20c784276db6b8e5ad362e0a7610ce Mon Sep 17 00:00:00 2001 From: Matthew Long Date: Tue, 3 Nov 2020 14:22:07 -0800 Subject: [PATCH 2/4] pipeline cleanup --- .pipelines/e2e-step-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/e2e-step-template.yaml b/.pipelines/e2e-step-template.yaml index 824ca6d4f9..26e9462630 100644 --- a/.pipelines/e2e-step-template.yaml +++ b/.pipelines/e2e-step-template.yaml @@ -85,7 +85,7 @@ steps: export CLIENT_SECRET=$(AKS_ENGINE_CLIENT_SECRET) export TENANT_ID=$(AKS_ENGINE_TENANT_ID) export SUBSCRIPTION_ID=$(AKS_ENGINE_SUBSCRIPTION_ID) - export CLEANUP_ON_EXIT=false + export CLEANUP_ON_EXIT=true export CLEANUP_IF_FAIL=false export REGIONS=$(AKS_ENGINE_REGION) export IS_JENKINS=false From fa943fac6f4ade6e6e359c95648460e4aa7f0ff2 Mon Sep 17 00:00:00 2001 From: Matthew Long <61910737+thatmattlong@users.noreply.github.com> Date: Wed, 4 Nov 2020 16:34:34 -0800 Subject: [PATCH 3/4] Use int64 for NC version in NNC status --- .../kubecontroller/crdrequestcontroller_test.go | 2 +- cns/requestcontroller/kubecontroller/crdtranslator.go | 2 +- .../kubecontroller/crdtranslator_test.go | 8 +++----- nodenetworkconfig/api/v1alpha/nodenetworkconfig.go | 2 +- .../manifests/acn.azure.com_nodenetworkconfigs.yaml | 3 ++- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cns/requestcontroller/kubecontroller/crdrequestcontroller_test.go b/cns/requestcontroller/kubecontroller/crdrequestcontroller_test.go index 1d451320ca..753d19c7eb 100644 --- a/cns/requestcontroller/kubecontroller/crdrequestcontroller_test.go +++ b/cns/requestcontroller/kubecontroller/crdrequestcontroller_test.go @@ -592,7 +592,7 @@ func TestInitRequestController(t *testing.T) { }, }, SubnetAddressSpace: subnetRange, - Version: "1", + Version: 1, }, }, }, diff --git a/cns/requestcontroller/kubecontroller/crdtranslator.go b/cns/requestcontroller/kubecontroller/crdtranslator.go index cb0a79d62e..4a57a68030 100644 --- a/cns/requestcontroller/kubecontroller/crdtranslator.go +++ b/cns/requestcontroller/kubecontroller/crdtranslator.go @@ -37,7 +37,7 @@ func CRDStatusToNCRequest(crdStatus nnc.NodeNetworkConfigStatus) (cns.CreateNetw ncRequest.SecondaryIPConfigs = make(map[string]cns.SecondaryIPConfig) ncRequest.NetworkContainerid = nc.ID ncRequest.NetworkContainerType = cns.Docker - ncRequest.Version = nc.Version + ncRequest.Version = strconv.FormatInt(nc.Version, 10) if ip = net.ParseIP(nc.PrimaryIP); ip == nil { return ncRequest, fmt.Errorf("Invalid PrimaryIP %s:", nc.PrimaryIP) diff --git a/cns/requestcontroller/kubecontroller/crdtranslator_test.go b/cns/requestcontroller/kubecontroller/crdtranslator_test.go index e34053950e..7fcb6fbffc 100644 --- a/cns/requestcontroller/kubecontroller/crdtranslator_test.go +++ b/cns/requestcontroller/kubecontroller/crdtranslator_test.go @@ -1,7 +1,6 @@ package kubecontroller import ( - "strconv" "testing" "github.com/Azure/azure-container-networking/cns" @@ -18,7 +17,7 @@ const ( subnetAddressSpace = "10.0.0.0/24" subnetPrefixLen = 24 testSecIp1 = "10.0.0.2" - version = "1" + version = 1 ) func TestStatusToNCRequestMalformedPrimaryIP(t *testing.T) { @@ -237,8 +236,7 @@ func TestStatusToNCRequestSuccess(t *testing.T) { t.Fatalf("Expected %v as the secondary IP config but got %v", testSecIp1, secondaryIP.IPAddress) } - ncVersionInInt, _ := strconv.Atoi(version) - if secondaryIP.NCVersion != ncVersionInInt { - t.Fatalf("Expected %d as the secondary IP config NC version but got %v", ncVersionInInt, secondaryIP.NCVersion) + if secondaryIP.NCVersion != version { + t.Fatalf("Expected %d as the secondary IP config NC version but got %v", version, secondaryIP.NCVersion) } } diff --git a/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go b/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go index 57722fde59..f33e7ac3c4 100644 --- a/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go +++ b/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go @@ -72,7 +72,7 @@ type NetworkContainer struct { IPAssignments []IPAssignment `json:"ipAssignments,omitempty"` DefaultGateway string `json:"defaultGateway,omitempty"` SubnetAddressSpace string `json:"subnetAddressSpace,omitempty"` - Version string `json:"version,omitempty"` + Version int64 `json:"version,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 a94868af2e..21747bfc64 100644 --- a/nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml +++ b/nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml @@ -76,7 +76,8 @@ spec: subnetName: type: string version: - type: string + format: int64 + type: integer type: object type: array scaler: From 9fd75e48d3680017564ca88a49a912822780427a Mon Sep 17 00:00:00 2001 From: Matthew Long <61910737+thatmattlong@users.noreply.github.com> Date: Mon, 30 Nov 2020 10:10:29 -0800 Subject: [PATCH 4/4] bump cns version to 1.2.0 --- cns/azure-cns.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cns/azure-cns.yaml b/cns/azure-cns.yaml index e87dd53595..411c407a55 100644 --- a/cns/azure-cns.yaml +++ b/cns/azure-cns.yaml @@ -93,7 +93,7 @@ spec: effect: NoSchedule containers: - name: cns-container - image: mcr.microsoft.com/containernetworking/azure-cns:v1.2.0-alpha + image: mcr.microsoft.com/containernetworking/azure-cns:v1.2.0 imagePullPolicy: IfNotPresent args: [ "-c", "tcp://$(CNSIpAddress):$(CNSPort)", "-t", "$(CNSLogTarget)"] volumeMounts: