@@ -178,9 +178,9 @@ type ipPoolState struct {
178178 totalIPs int64
179179}
180180
181- func buildIPPoolState (ips map [string ]cns.IPConfigurationStatus , spec v1alpha.NodeNetworkConfigSpec , primaryIPAddresses map [ string ] struct {} ) ipPoolState {
181+ func buildIPPoolState (ips map [string ]cns.IPConfigurationStatus , spec v1alpha.NodeNetworkConfigSpec ) ipPoolState {
182182 state := ipPoolState {
183- totalIPs : int64 (len (primaryIPAddresses ) + len ( ips )),
183+ totalIPs : int64 (len (ips )),
184184 requestedIPs : spec .RequestedIPCount ,
185185 }
186186 for _ , v := range ips {
@@ -205,22 +205,22 @@ var statelogDownsample int
205205func (pm * Monitor ) reconcile (ctx context.Context ) error {
206206 allocatedIPs := pm .httpService .GetPodIPConfigState ()
207207 meta := pm .metastate
208- state := buildIPPoolState (allocatedIPs , pm .spec , meta . primaryIPAddresses )
208+ state := buildIPPoolState (allocatedIPs , pm .spec )
209209 observeIPPoolState (state , meta , []string {subnet , subnetCIDR , subnetARMID })
210210
211+ // log every 30th reconcile to reduce the AI load. we will always log when the monitor
212+ // changes the pool, below.
213+ if statelogDownsample = (statelogDownsample + 1 ) % 30 ; statelogDownsample == 0 { //nolint:gomnd //downsample by 30
214+ logger .Printf ("ipam-pool-monitor state: %+v, meta: %+v" , state , meta )
215+ }
216+
211217 // if the subnet is exhausted, overwrite the batch/minfree/maxfree in the meta copy for this iteration
212218 if meta .exhausted {
213219 meta .batch = 1
214220 meta .minFreeCount = 1
215221 meta .maxFreeCount = 2
216222 }
217223
218- // log every 30th reconcile to reduce the AI load. we will always log when the monitor
219- // changes the pool, below.
220- if statelogDownsample = (statelogDownsample + 1 ) % 30 ; statelogDownsample == 0 { //nolint:gomnd //downsample by 30
221- logger .Printf ("ipam-pool-monitor state %+v" , state )
222- }
223-
224224 switch {
225225 // pod count is increasing
226226 case state .expectedAvailableIPs < meta .minFreeCount :
0 commit comments