Revision 89cc23c09ec31bba50521495d6e352204feec72f authored by David Bimmler on 19 March 2024, 08:48:32 UTC, committed by Jussi Mäki on 05 April 2024, 12:00:13 UTC
[ upstream commit 58ad35a84faab45fa0dab5f0078287f4cceb3926 ]

The endpointmanagers idallocator package was using a package global pool
for its identifier allocation. That's fine for running the agent, but
causes flakes in testing when multiple tests access the same pool. It's
also not idiomatic Go.

This patch makes the local endpoint identifier allocator a struct, and
the next patch will move it into the endpointmanager package itself, as
there is no other consumer.

While at it, also ensure that the RemoveAll method is only called from a
testing context, by taking a testing.TB as an argument. We cannot simply
move the method into the _test.go files, as tests from other packages
use it.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
Signed-off-by: Jussi Maki <jussi@isovalent.com>
1 parent fdfbb25
History

README.md

back to top