Skip to content

Commit 8467aad

Browse files
committed
feat:add NetworkInterfaceInfo details to getallNCResponse in cns, to be used by CNI ADD net-plugin
1 parent fc7974f commit 8467aad

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cns/NetworkContainerContract.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,18 @@ type CreateNetworkContainerRequest struct {
109109
AllowNCToHostCommunication bool
110110
EndpointPolicies []NetworkContainerRequestPolicies
111111
NCStatus v1alpha.NCStatus
112-
networkInterfaceInfo NetworkInterfaceInfo //nolint // introducing new field for backendnic, to be used later by cni code
112+
NetworkInterfaceInfo NetworkInterfaceInfo //nolint // introducing new field for backendnic, to be used later by cni code
113113
}
114114

115115
// CreateNetworkContainerRequest implements fmt.Stringer for logging
116116
func (req *CreateNetworkContainerRequest) String() string {
117117
return fmt.Sprintf("CreateNetworkContainerRequest"+
118118
"{Version: %s, NetworkContainerType: %s, NetworkContainerid: %s, PrimaryInterfaceIdentifier: %s, "+
119119
"LocalIPConfiguration: %+v, IPConfiguration: %+v, SecondaryIPConfigs: %+v, MultitenancyInfo: %+v, "+
120-
"AllowHostToNCCommunication: %t, AllowNCToHostCommunication: %t, NCStatus: %s}",
120+
"AllowHostToNCCommunication: %t, AllowNCToHostCommunication: %t, NCStatus: %s, NetworkInterfaceInfo: %+v}",
121121
req.Version, req.NetworkContainerType, req.NetworkContainerid, req.PrimaryInterfaceIdentifier, req.LocalIPConfiguration,
122-
req.IPConfiguration, req.SecondaryIPConfigs, req.MultiTenancyInfo, req.AllowHostToNCCommunication, req.AllowNCToHostCommunication, string(req.NCStatus))
122+
req.IPConfiguration, req.SecondaryIPConfigs, req.MultiTenancyInfo, req.AllowHostToNCCommunication, req.AllowNCToHostCommunication,
123+
string(req.NCStatus), req.NetworkInterfaceInfo)
123124
}
124125

125126
// NetworkContainerRequestPolicies - specifies policies associated with create network request
@@ -322,7 +323,7 @@ type MultiTenancyInfo struct {
322323
}
323324

324325
type NetworkInterfaceInfo struct {
325-
NICType string
326+
NICType NICType
326327
MACAddress string
327328
}
328329

@@ -418,6 +419,7 @@ type GetNetworkContainerResponse struct {
418419
Response Response
419420
AllowHostToNCCommunication bool
420421
AllowNCToHostCommunication bool
422+
NetworkInterfaceInfo NetworkInterfaceInfo
421423
}
422424

423425
type PodIpInfo struct {

cns/restserver/util.go

+1
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ func (service *HTTPRestService) getAllNetworkContainerResponses(
501501
LocalIPConfiguration: savedReq.LocalIPConfiguration,
502502
AllowHostToNCCommunication: savedReq.AllowHostToNCCommunication,
503503
AllowNCToHostCommunication: savedReq.AllowNCToHostCommunication,
504+
NetworkInterfaceInfo: savedReq.NetworkInterfaceInfo,
504505
}
505506

506507
// If the NC version check wasn't skipped, take into account the VFP programming status when returning the response

0 commit comments

Comments
 (0)