Skip to content

Commit b5bf968

Browse files
committed
lint fixes and address comment
Signed-off-by: Tamilmani <[email protected]>
1 parent 0134df3 commit b5bf968

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

cni/network/network.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,8 @@ func (plugin *NetPlugin) createEpInfo(opt *createEpInfoOpt) (*network.EndpointIn
678678
opt.ifInfo.HostSubnetPrefix.IP = opt.ifInfo.HostSubnetPrefix.IP.Mask(opt.ifInfo.HostSubnetPrefix.Mask)
679679
opt.ipamAddConfig.nwCfg.IPAM.Subnet = opt.ifInfo.HostSubnetPrefix.String()
680680

681-
var masterIfName string
682681
// populate endpoint info section
683-
masterIfName = plugin.findMasterInterface(opt)
682+
masterIfName := plugin.findMasterInterface(opt)
684683
if masterIfName == "" {
685684
err := plugin.Errorf("Failed to find the master interface")
686685
return nil, err

cni/network/network_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (plugin *NetPlugin) getNetworkName(netNs string, interfaceInfo *network.Int
7979
}
8080

8181
if interfaceInfo != nil && interfaceInfo.NICType == cns.ApipaNIC {
82-
return swiftv2NetworkNamePrefix + "apipa", nil
82+
return swiftv2NetworkNamePrefix + apipaInterfacePrefix, nil
8383
}
8484

8585
// For singletenancy, the network name is simply the nwCfg.Name

cns/endpointmanager/endpointmanager_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (em *EndpointManager) ReleaseIPs(ctx context.Context, ipconfigreq cns.IPCon
1717
logger.Errorf("failed to remove HNS endpoint %s", err.Error())
1818
}
1919

20-
return em.cli.ReleaseIPs(ctx, ipconfigreq)
20+
return errors.Wrap(em.cli.ReleaseIPs(ctx, ipconfigreq), "failed to release IP from CNS")
2121
}
2222

2323
// deleteEndpoint API to get the state and then remove assiciated HNS

cns/restserver/ipam.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func (service *HTTPRestService) requestIPConfigHandlerHelperStandalone(ctx conte
161161
podIPInfoList = append(podIPInfoList, podIPInfo)
162162
if resp[i].AllowHostToNCCommunication || resp[i].AllowNCToHostCommunication {
163163
apipaIndex = i
164+
break
164165
}
165166
}
166167

network/endpoint_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,14 @@ func (nw *network) createHostNCApipaEndpoint(cli apipaClient, epInfo *EndpointIn
404404

405405
if namespace, err = hcn.GetNamespaceByID(epInfo.NetNsPath); err != nil {
406406
return nil, fmt.Errorf("Failed to retrieve namespace with GetNamespaceByID for NetNsPath: %s"+
407-
" due to error: %v", epInfo.NetNsPath, err)
407+
" due to error: %v", epInfo.NetNsPath, err) //nolint
408408
}
409409

410410
logger.Info("Creating HostNCApipaEndpoint for host container connectivity for NC",
411411
zap.String("NetworkContainerID", epInfo.NetworkContainerID))
412412

413413
if hostNCApipaEndpointID, err = cli.CreateHostNCApipaEndpoint(context.TODO(), epInfo.NetworkContainerID); err != nil {
414-
return nil, err
414+
return nil, err //nolint
415415
}
416416

417417
defer func() {

0 commit comments

Comments
 (0)