Skip to content

Commit

Permalink
fix: revert locking in getclusteraccessor
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Wöhrl <[email protected]>
  • Loading branch information
woehrl01 committed Feb 11, 2024
1 parent 9f50589 commit 1bb3db9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controller/sharding/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ func hasShardingUpdates(old, new *v1alpha1.Cluster) bool {

func (d *ClusterSharding) GetClusterAccessor() clusterAccessor {
return func() []*v1alpha1.Cluster {
d.lock.RLock()
defer d.lock.RUnlock()
// no need to lock, as this is only called from the updateDistribution function
clusters := make([]*v1alpha1.Cluster, 0, len(d.Clusters))
for _, c := range d.Clusters {
clusters = append(clusters, c)
Expand Down

0 comments on commit 1bb3db9

Please sign in to comment.