@@ -71,7 +71,7 @@ type EndpointClient interface {
71
71
72
72
// NetworkManager manages the set of container networking resources.
73
73
type networkManager struct {
74
- StatelessCniMode bool
74
+ statelessCniMode bool
75
75
CnsClient * cnsclient.Client
76
76
Version string
77
77
TimeStamp time.Time
@@ -150,7 +150,7 @@ func (nm *networkManager) Uninitialize() {
150
150
151
151
// SetStatelessCNIMode enable the statelessCNI falg and inititlizes a CNSClient
152
152
func (nm * networkManager ) SetStatelessCNIMode () error {
153
- nm .StatelessCniMode = true
153
+ nm .statelessCniMode = true
154
154
// Create CNS client
155
155
client , err := cnsclient .New (cnsBaseURL , cnsReqTimeout )
156
156
if err != nil {
@@ -162,7 +162,7 @@ func (nm *networkManager) SetStatelessCNIMode() error {
162
162
163
163
// IsStatelessCNIMode checks if the Stateless CNI mode has been enabled or not
164
164
func (nm * networkManager ) IsStatelessCNIMode () bool {
165
- return nm .StatelessCniMode
165
+ return nm .statelessCniMode
166
166
}
167
167
168
168
// Restore reads network manager state from persistent store.
@@ -500,7 +500,6 @@ func (nm *networkManager) DeleteEndpointState(networkID string, epInfo *Endpoint
500
500
EnableSnatOnHost : false ,
501
501
EnableMultitenancy : false ,
502
502
NetworkContainerID : epInfo .Id ,
503
- SecondaryInterfaces : epInfo .SecondaryInterfaces ,
504
503
}
505
504
logger .Info ("Deleting endpoint with" , zap .String ("Endpoint Info: " , epInfo .PrettyString ()), zap .String ("HNISID : " , ep .HnsId ))
506
505
return nw .deleteEndpointImpl (netlink .NewNetlink (), platform .NewExecClient (logger ), nil , nil , nil , nil , ep )
@@ -690,30 +689,23 @@ func (nm *networkManager) GetEndpointID(containerID, ifName string) string {
690
689
691
690
func cnsEndpointInfotoCNIEpInfo (endpointInfo restserver.EndpointInfo , endpointID string ) * EndpointInfo {
692
691
epInfo := & EndpointInfo {
693
- Id : endpointID ,
694
- IfIndex : EndpointIfIndex , // Azure CNI supports only one interface
695
- ContainerID : endpointID ,
696
- PODName : endpointInfo .PodName ,
697
- PODNameSpace : endpointInfo .PodNamespace ,
698
- NetworkContainerID : endpointID ,
699
- SecondaryInterfaces : make (map [string ]* InterfaceInfo ),
700
- }
701
- // filling out the InfraNIC from the state
692
+ Id : endpointID ,
693
+ IfIndex : EndpointIfIndex , // Azure CNI supports only one interface
694
+ ContainerID : endpointID ,
695
+ PODName : endpointInfo .PodName ,
696
+ PODNameSpace : endpointInfo .PodNamespace ,
697
+ NetworkContainerID : endpointID ,
698
+ }
699
+
702
700
for ifName , ipInfo := range endpointInfo .IfnameToIPMap {
703
- if ifName == InfraInterfaceName {
701
+ if ifName == InfraInterfaceName { // filling out the InfraNIC from the state
704
702
epInfo .IPAddresses = ipInfo .IPv4
705
703
epInfo .IPAddresses = append (epInfo .IPAddresses , ipInfo .IPv6 ... )
706
704
epInfo .IfName = ifName
707
705
epInfo .HostIfName = ipInfo .HostVethName
708
706
epInfo .HNSEndpointID = ipInfo .HnsEndpointID
709
- } else { // filling out the SecondaryNICs from the state
710
- interfaceInfo := & InterfaceInfo {
711
- Name : ifName ,
712
- IPConfigs : generateIPConfigfromState (ipInfo ),
713
- NICType : ipInfo .NICType ,
714
- }
715
- epInfo .SecondaryInterfaces [ifName ] = interfaceInfo
716
707
}
708
+ // TODO: filling out the SecondaryNICs from the state for Swift 2.0
717
709
}
718
710
return epInfo
719
711
}
0 commit comments