kubernetes/pkg/controller/endpointslice
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
..
config generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
metrics pkg/controller: Replace deprecated func usage from the k8s.io/utils/pointer pkg 2022-11-23 17:40:23 +02:00
topologycache TopologyAwareHints: Take lock in HasPopulatedHints 2023-08-31 16:38:51 -04:00
endpointslice_controller.go Fix TopologyAwareHint not working when zone label is added after Node creation 2023-04-13 11:13:00 +08:00
endpointslice_controller_test.go Fix TopologyAwareHint not working when zone label is added after Node creation 2023-04-13 11:13:00 +08:00
OWNERS Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00
reconciler.go Remove unused numExistingEndpoints variable 2022-11-23 00:54:50 +00:00
reconciler_test.go Introducing Topology Mode Annotation, Deprecating Topology Hints 2023-03-14 02:23:11 +00:00
utils.go Introducing Topology Mode Annotation, Deprecating Topology Hints 2023-03-14 02:23:11 +00:00
utils_test.go Introducing Topology Mode Annotation, Deprecating Topology Hints 2023-03-14 02:23:11 +00:00