Skip to content

Commit

Permalink
Add mutex lock to updateServer
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Leong <[email protected]>
  • Loading branch information
adleong committed Jul 25, 2023
1 parent 32831ba commit be35415
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/api/destination/watcher/endpoints_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,9 @@ func (sp *servicePublisher) metricsLabels(port Port, hostname string) prometheus
}

func (sp *servicePublisher) updateServer(server *v1beta1.Server, isAdd bool) {
sp.Lock()
defer sp.Unlock()

selector, err := metav1.LabelSelectorAsSelector(server.Spec.PodSelector)
if err != nil {
sp.log.Errorf("failed to create Selector: %s", err)
Expand Down

0 comments on commit be35415

Please sign in to comment.