From 219e7efee4564041f0f7e8b5130b3819885c2949 Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Mon, 26 Jul 2021 17:57:54 +0800 Subject: [PATCH] feat: set primaryInterfaceIdentifier for cns.CreateNetworkContainerRequest --- .../multitenantoperator/multitenantcrdreconciler.go | 2 ++ .../api/v1alpha1/multitenantnetworkcontainer_types.go | 2 ++ .../networking.azure.com_multitenantnetworkcontainers.yaml | 3 +++ 3 files changed, 7 insertions(+) diff --git a/cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go b/cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go index f0860ced3..1b17cc7a0 100644 --- a/cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go +++ b/cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go @@ -127,7 +127,9 @@ func (r *multiTenantCrdReconciler) Reconcile(request reconcile.Request) (reconci }, GatewayIPAddress: nc.Status.Gateway, }, + PrimaryInterfaceIdentifier: nc.Status.PrimaryInterfaceIdentifier, } + logger.Printf("CreateOrUpdateNC with networkContainerRequest: %#v", networkContainerRequest) if err = r.CNSClient.CreateOrUpdateNC(networkContainerRequest); err != nil { logger.Errorf("Failed to persist state for NC %s (UUID: %s) to CNS: %v", request.NamespacedName.String(), nc.Spec.UUID, err) return ctrl.Result{}, err diff --git a/crds/multitenantnetworkcontainer/api/v1alpha1/multitenantnetworkcontainer_types.go b/crds/multitenantnetworkcontainer/api/v1alpha1/multitenantnetworkcontainer_types.go index 509557554..67bd75c8d 100644 --- a/crds/multitenantnetworkcontainer/api/v1alpha1/multitenantnetworkcontainer_types.go +++ b/crds/multitenantnetworkcontainer/api/v1alpha1/multitenantnetworkcontainer_types.go @@ -48,6 +48,8 @@ type MultiTenantNetworkContainerStatus struct { State string `json:"state,omitempty"` // The subnet CIDR IPSubnet string `json:"ipSubnet,omitempty"` + // The primary interface identifier + PrimaryInterfaceIdentifier string `json:"primaryInterfaceIdentifier,omitempty"` } // +kubebuilder:object:root=true diff --git a/crds/multitenantnetworkcontainer/manifests/networking.azure.com_multitenantnetworkcontainers.yaml b/crds/multitenantnetworkcontainer/manifests/networking.azure.com_multitenantnetworkcontainers.yaml index 9f47b2479..a6ec51433 100644 --- a/crds/multitenantnetworkcontainer/manifests/networking.azure.com_multitenantnetworkcontainers.yaml +++ b/crds/multitenantnetworkcontainer/manifests/networking.azure.com_multitenantnetworkcontainers.yaml @@ -70,6 +70,9 @@ spec: ipSubnet: description: The subnet CIDR type: string + primaryInterfaceIdentifier: + description: The primary interface identifier + type: string state: description: The state of network container type: string