diff --git a/cns/NetworkContainerContract.go b/cns/NetworkContainerContract.go index 8f444e6f90..d1c9329fd3 100644 --- a/cns/NetworkContainerContract.go +++ b/cns/NetworkContainerContract.go @@ -109,7 +109,7 @@ type CreateNetworkContainerRequest struct { AllowNCToHostCommunication bool EndpointPolicies []NetworkContainerRequestPolicies NCStatus v1alpha.NCStatus - networkInterfaceInfo NetworkInterfaceInfo //nolint // introducing new field for backendnic, to be used later by cni code + NetworkInterfaceInfo NetworkInterfaceInfo //nolint // introducing new field for backendnic, to be used later by cni code } // CreateNetworkContainerRequest implements fmt.Stringer for logging @@ -117,9 +117,10 @@ func (req *CreateNetworkContainerRequest) String() string { return fmt.Sprintf("CreateNetworkContainerRequest"+ "{Version: %s, NetworkContainerType: %s, NetworkContainerid: %s, PrimaryInterfaceIdentifier: %s, "+ "LocalIPConfiguration: %+v, IPConfiguration: %+v, SecondaryIPConfigs: %+v, MultitenancyInfo: %+v, "+ - "AllowHostToNCCommunication: %t, AllowNCToHostCommunication: %t, NCStatus: %s}", + "AllowHostToNCCommunication: %t, AllowNCToHostCommunication: %t, NCStatus: %s, NetworkInterfaceInfo: %+v}", req.Version, req.NetworkContainerType, req.NetworkContainerid, req.PrimaryInterfaceIdentifier, req.LocalIPConfiguration, - req.IPConfiguration, req.SecondaryIPConfigs, req.MultiTenancyInfo, req.AllowHostToNCCommunication, req.AllowNCToHostCommunication, string(req.NCStatus)) + req.IPConfiguration, req.SecondaryIPConfigs, req.MultiTenancyInfo, req.AllowHostToNCCommunication, req.AllowNCToHostCommunication, + string(req.NCStatus), req.NetworkInterfaceInfo) } // NetworkContainerRequestPolicies - specifies policies associated with create network request @@ -322,7 +323,7 @@ type MultiTenancyInfo struct { } type NetworkInterfaceInfo struct { - NICType string + NICType NICType MACAddress string } @@ -418,6 +419,7 @@ type GetNetworkContainerResponse struct { Response Response AllowHostToNCCommunication bool AllowNCToHostCommunication bool + NetworkInterfaceInfo NetworkInterfaceInfo } type PodIpInfo struct { diff --git a/cns/restserver/util.go b/cns/restserver/util.go index 46b6f4e8b4..094fe49872 100644 --- a/cns/restserver/util.go +++ b/cns/restserver/util.go @@ -501,6 +501,7 @@ func (service *HTTPRestService) getAllNetworkContainerResponses( LocalIPConfiguration: savedReq.LocalIPConfiguration, AllowHostToNCCommunication: savedReq.AllowHostToNCCommunication, AllowNCToHostCommunication: savedReq.AllowNCToHostCommunication, + NetworkInterfaceInfo: savedReq.NetworkInterfaceInfo, } // If the NC version check wasn't skipped, take into account the VFP programming status when returning the response