Skip to content

Commit c9d1841

Browse files
authored
Remove Log noise from ipam pool monitor (#798)
* Remove Log noise from ipam pool monitor * incorporate feedback * Fix logging string * build fix
1 parent 6586840 commit c9d1841

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cns/ipampoolmonitor/ipampoolmonitor.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,29 +70,29 @@ func (pm *CNSIPAMPoolMonitor) Reconcile() error {
7070
availableIPConfigCount := len(pm.cns.GetAvailableIPConfigs()) // TODO: add pending allocation count to real cns
7171
freeIPConfigCount := pm.cachedNNC.Spec.RequestedIPCount - int64(allocatedPodIPCount)
7272

73-
logger.Printf("[ipam-pool-monitor] Checking pool for resize, Pool Size: %v, Goal Size: %v, BatchSize: %v, MinFree: %v, MaxFree:%v, Allocated: %v, Available: %v, Pending Release: %v, Free: %v, Pending Program: %v",
73+
msg := fmt.Sprintf("Pool Size: %v, Goal Size: %v, BatchSize: %v, MinFree: %v, MaxFree:%v, Allocated: %v, Available: %v, Pending Release: %v, Free: %v, Pending Program: %v",
7474
cnsPodIPConfigCount, pm.cachedNNC.Spec.RequestedIPCount, pm.scalarUnits.BatchSize, pm.MinimumFreeIps, pm.MaximumFreeIps, allocatedPodIPCount, availableIPConfigCount, pendingReleaseIPCount, freeIPConfigCount, pendingProgramCount)
7575

7676
switch {
7777
// pod count is increasing
7878
case freeIPConfigCount < pm.MinimumFreeIps:
79-
logger.Printf("[ipam-pool-monitor] Increasing pool size...")
79+
logger.Printf("[ipam-pool-monitor] Increasing pool size...%s ", msg)
8080
return pm.increasePoolSize()
8181

8282
// pod count is decreasing
8383
case freeIPConfigCount > pm.MaximumFreeIps:
84-
logger.Printf("[ipam-pool-monitor] Decreasing pool size...")
84+
logger.Printf("[ipam-pool-monitor] Decreasing pool size...%s ", msg)
8585
return pm.decreasePoolSize()
8686

8787
// CRD has reconciled CNS state, and target spec is now the same size as the state
8888
// free to remove the IP's from the CRD
8989
case pm.pendingRelease && int(pm.cachedNNC.Spec.RequestedIPCount) == cnsPodIPConfigCount:
90-
logger.Printf("[ipam-pool-monitor] Removing Pending Release IP's from CRD...")
90+
logger.Printf("[ipam-pool-monitor] Removing Pending Release IP's from CRD...%s ", msg)
9191
return pm.cleanPendingRelease()
9292

9393
// no pods scheduled
9494
case allocatedPodIPCount == 0:
95-
logger.Printf("[ipam-pool-monitor] No pods scheduled")
95+
logger.Printf("[ipam-pool-monitor] No pods scheduled, %s", msg)
9696
return nil
9797
}
9898

0 commit comments

Comments
 (0)