Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataStore.GetStats() refactoring to simplify adding new fields #1704

Merged
merged 16 commits into from
Nov 25, 2021
Prev Previous commit
Next Next commit
goimports
  • Loading branch information
veshij committed Oct 22, 2021
commit 3787c1a42faccb306e3391586972c33fc4f13f96
2 changes: 1 addition & 1 deletion pkg/ipamd/datastore/data_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ func (ds *DataStore) unassignPodIPAddressUnsafe(addr *AddressInfo) {

type DataStoreStats struct {
// Total number of addresses allocated
TotalIPs int
TotalIPs int
// Total number of prefixes allocated
TotalPrefixes int

Expand Down
6 changes: 3 additions & 3 deletions pkg/ipamd/datastore/data_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ func TestGetStatsV6(t *testing.T) {

assert.Equal(t,
DataStoreStats{
TotalIPs: 281474976710656,
TotalIPs: 281474976710656,
TotalPrefixes: 1,
AssignedIPs: 1,
CooldownIPs: 0,
AssignedIPs: 1,
CooldownIPs: 0,
},
v6ds.GetStats("6"),
)
Expand Down