Skip to content

Commit

Permalink
feat:add NetworkInterfaceInfo details to getallNCResponse in cns, to …
Browse files Browse the repository at this point in the history
…be used by CNI ADD net-plugin
  • Loading branch information
kmurudi authored and paulyufan2 committed Oct 27, 2023
1 parent 32865c1 commit 2898688
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cns/NetworkContainerContract.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,18 @@ 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
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
Expand Down Expand Up @@ -322,7 +323,7 @@ type MultiTenancyInfo struct {
}

type NetworkInterfaceInfo struct {
NICType string
NICType NICType
MACAddress string
}

Expand Down Expand Up @@ -418,6 +419,7 @@ type GetNetworkContainerResponse struct {
Response Response
AllowHostToNCCommunication bool
AllowNCToHostCommunication bool
NetworkInterfaceInfo NetworkInterfaceInfo
}

type PodIpInfo struct {
Expand Down
1 change: 1 addition & 0 deletions cns/restserver/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2898688

Please sign in to comment.