Skip to content

Commit fc7974f

Browse files
committed
fix: refactor networkInterfaceInfo
1 parent 05f6f10 commit fc7974f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

cns/NetworkContainerContract.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const (
5151
Basic = "Basic"
5252
JobObject = "JobObject"
5353
COW = "COW" // Container on Windows
54-
BackendNIC = "BackendNIC"
54+
BackendNICNC = "BackendNICNC"
5555
)
5656

5757
// Orchestrator Types
@@ -78,6 +78,8 @@ const (
7878
InfraNIC NICType = "InfraNIC"
7979
// Delegated VM NICs are projected from VM to container network namespace
8080
DelegatedVMNIC NICType = "DelegatedVMNIC"
81+
// BackendNIC NICs are used for infiniband nics on a VM
82+
BackendNIC NICType = "BackendNIC"
8183
)
8284

8385
// ChannelMode :- CNS channel modes
@@ -107,7 +109,7 @@ type CreateNetworkContainerRequest struct {
107109
AllowNCToHostCommunication bool
108110
EndpointPolicies []NetworkContainerRequestPolicies
109111
NCStatus v1alpha.NCStatus
110-
backendNICInfo BackendNICInfo //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
111113
}
112114

113115
// CreateNetworkContainerRequest implements fmt.Stringer for logging
@@ -319,7 +321,7 @@ type MultiTenancyInfo struct {
319321
ID int // This can be vlanid, vxlanid, gre-key etc. (depends on EnacapType).
320322
}
321323

322-
type BackendNICInfo struct {
324+
type NetworkInterfaceInfo struct {
323325
NICType string
324326
MACAddress string
325327
}
@@ -422,7 +424,7 @@ type PodIpInfo struct {
422424
PodIPConfig IPSubnet
423425
NetworkContainerPrimaryIPConfig IPConfiguration
424426
HostPrimaryIPInfo HostIPInfo
425-
// NICType defines whether NIC is InfraNIC or DelegatedVMNIC
427+
// NICType defines whether NIC is InfraNIC or DelegatedVMNIC or BackendNIC
426428
NICType NICType
427429
InterfaceName string
428430
// MacAddress of interface

cns/restserver/util.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (service *HTTPRestService) saveNetworkContainerGoalState(
163163
fallthrough
164164
case cns.JobObject:
165165
fallthrough
166-
case cns.COW, cns.BackendNIC:
166+
case cns.COW, cns.BackendNICNC:
167167
fallthrough
168168
case cns.WebApps:
169169
switch service.state.OrchestratorType {
@@ -177,7 +177,7 @@ func (service *HTTPRestService) saveNetworkContainerGoalState(
177177
fallthrough
178178
case cns.AzureFirstParty:
179179
fallthrough
180-
case cns.WebApps, cns.BackendNIC: // todo: Is WebApps an OrchastratorType or ContainerType?
180+
case cns.WebApps, cns.BackendNICNC: // todo: Is WebApps an OrchastratorType or ContainerType?
181181
podInfo, err := cns.UnmarshalPodInfo(req.OrchestratorContext)
182182
if err != nil {
183183
errBuf := fmt.Sprintf("Unmarshalling %s failed with error %v", req.NetworkContainerType, err)

0 commit comments

Comments
 (0)