Skip to content

Commit 14d0336

Browse files
fix conflits
small fixes fix lint errors lint fix . Delete examples/imds_nc_lookup.go Signed-off-by: NihaNallappagari <[email protected]> fix lint .
1 parent 9da8675 commit 14d0336

File tree

3 files changed

+10
-208
lines changed

3 files changed

+10
-208
lines changed

cns/restserver/internalapi.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ func (service *HTTPRestService) CreateOrUpdateNetworkContainerInternal(req *cns.
620620
} else {
621621
logger.Errorf(returnMessage)
622622
}
623+
623624
if service.Options[common.OptProgramSNATIPTables] == true {
624625
returnCode, returnMessage = service.programSNATRules(req)
625626
if returnCode != 0 {

cns/restserver/ipam.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ func (service *HTTPRestService) AssignAvailableIPConfigs(podInfo cns.PodInfo) ([
998998
}
999999

10001000
// Get the number of distinct IP families (IPv4/IPv6) across all NC's
1001-
numOfIPFamilies := service.GetIpFamilyCount()
1001+
numOfIPFamilies := service.GetIPFamilyCount()
10021002

10031003
// Get the actual IP families map for validation
10041004
ncIPFamilies := service.getIPFamiliesMap()
@@ -1088,7 +1088,11 @@ func (service *HTTPRestService) AssignAvailableIPConfigs(podInfo cns.PodInfo) ([
10881088
return podIPInfo, fmt.Errorf("not enough IPs available, waiting on Azure CNS to allocate more")
10891089
}
10901090

1091-
logger.Printf("[AssignAvailableIPConfigs] Successfully assigned IPs for pod %+v", podInfo)
1091+
//lint:ignore SA1019 suppress deprecated logger.Printf usage. Todo: legacy logger usage is consistent in cns repo. Migrates when all logger usage is migrated
1092+
logger.Printf(
1093+
"[AssignAvailableIPConfigs] Successfully assigned IPs for pod %+v",
1094+
podInfo,
1095+
)
10921096
return podIPInfo, nil
10931097
}
10941098

@@ -1389,10 +1393,10 @@ func (service *HTTPRestService) getIPFamiliesMap() map[cns.IPFamily]struct{} {
13891393
return ncIPFamilies
13901394
}
13911395

1392-
// GetIpFamilyCount returns the number of distinct IP families (IPv4/IPv6) across all NC's.
1396+
// GetIPFamilyCount returns the number of distinct IP families (IPv4/IPv6) across all NC's.
13931397
// This is used to determine how many IPs to assign per pod:
13941398
// - In single-stack: 1 IP per pod
13951399
// - In dual-stack: 2 IPs per pod (one IPv4, one IPv6)
1396-
func (service *HTTPRestService) GetIpFamilyCount() int {
1400+
func (service *HTTPRestService) GetIPFamilyCount() int {
13971401
return len(service.getIPFamiliesMap())
13981402
}

0 commit comments

Comments
 (0)