kubernetes/pkg/controller/endpointslice/topologycache
Miciah Masters fc18ffe58d TopologyAwareHints: Take lock in HasPopulatedHints
Prevent potential concurrent map access by taking a lock before reading the
topology cache's hintsPopulatedByService map.

* staging/src/k8s.io/endpointslice/topologycache/topologycache.go
(setHintsLocked, hasPopulatedHintsLocked): New helper functions.  These are
the same as the existing SetHints and HasPopulatedHints methods except that
these helpers assume that a lock is already held.
(SetHints): Use setHintsLocked.
(HasPopulatedHints): Take a lock and use hasPopulatedHintsLocked.
(AddHints): Take a lock and use setHintsLocked and hasPopulatedHintsLocked.
* staging/src/k8s.io/endpointslice/topologycache/topologycache_test.go
(TestTopologyCacheRace): Add a goroutine that calls HasPopulatedHints.
2023-08-31 16:38:51 -04:00
..
event.go Added events publishing for topologyHints changes 2022-11-07 19:45:40 +00:00
sliceinfo.go Generate and format files 2022-07-26 13:14:05 -04:00
sliceinfo_test.go pkg/controller: Replace deprecated func usage from the k8s.io/utils/pointer pkg 2022-11-23 17:40:23 +02:00
topologycache.go TopologyAwareHints: Take lock in HasPopulatedHints 2023-08-31 16:38:51 -04:00
topologycache_test.go TopologyAwareHints: Take lock in HasPopulatedHints 2023-08-31 16:38:51 -04:00
utils.go Added events publishing for topologyHints changes 2022-11-07 19:45:40 +00:00
utils_test.go pkg/controller: Replace deprecated func usage from the k8s.io/utils/pointer pkg 2022-11-23 17:40:23 +02:00