Skip to content

Commit

Permalink
Remove extra decrement of totalIP count (#2042)
Browse files Browse the repository at this point in the history
* Remove extra decrement of totalIP count

* Updates UTs
  • Loading branch information
jayanthvn authored Oct 12, 2022
1 parent 9023f57 commit e65d256
Show file tree
Hide file tree
Showing 2 changed files with 494 additions and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/ipamd/datastore/data_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1220,10 +1220,7 @@ func (ds *DataStore) UnassignPodIPAddress(ipamKey IPAMKey) (e *ENI, ip string, d
return nil, "", 0, err
}
addr.UnassignedTime = time.Now()
if ds.isPDEnabled && !availableCidr.IsPrefix {
ds.log.Infof("Prefix delegation is enabled and the IP is from secondary pool hence no need to update prefix pool")
ds.total--
}

//Update prometheus for ips per cidr
ipsPerCidr.With(prometheus.Labels{"cidr": availableCidr.Cidr.String()}).Dec()
ds.log.Infof("UnassignPodIPAddress: sandbox %s's ipAddr %s, DeviceNumber %d",
Expand Down
Loading

0 comments on commit e65d256

Please sign in to comment.