File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -229,8 +229,15 @@ func (iMgr *IPSetManager) setsWithReferences() map[string]struct{} {
229
229
var setsWithReferences map [string ]struct {}
230
230
if haveRefsStill {
231
231
setsWithReferences = readByteLinesToMap (setsWithReferencesBytes )
232
+ subset := make (map [string ]struct {}, maxLinesToPrint )
233
+ for key := range setsWithReferences {
234
+ subset [key ] = struct {}{}
235
+ if len (subset ) >= maxLinesToPrint {
236
+ break
237
+ }
238
+ }
232
239
metrics .SendErrorLogAndMetric (util .IpsmID , "error: found leaked reference counts in kernel. ipsets (max %d): %+v. err: %v" ,
233
- maxLinesToPrint , setsWithReferences , err )
240
+ maxLinesToPrint , subset , err )
234
241
}
235
242
236
243
return setsWithReferences
@@ -847,9 +854,6 @@ func readByteLinesToMap(output []byte) map[string]struct{} {
847
854
line , readIndex = parse .Line (readIndex , output )
848
855
hashedSetName := strings .Trim (string (line ), "\n " )
849
856
lines [hashedSetName ] = struct {}{}
850
- if len (lines ) > maxLinesToPrint {
851
- break
852
- }
853
857
}
854
858
return lines
855
859
}
You can’t perform that action at this time.
0 commit comments