Skip to content

Commit

Permalink
add lock in spirit of #564
Browse files Browse the repository at this point in the history
  • Loading branch information
yuval-k committed May 21, 2024
1 parent 14dd407 commit c6dd2c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/pkg/sets/v2/sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ func (s *resourceSet[T]) Delete(resource ezkube.ResourceId) {
}

func (s *resourceSet[T]) Union(set ResourceSet[T]) ResourceSet[T] {
s.lock.RLock()
defer s.lock.RUnlock()
list := []T{}
for _, resource := range s.Generic().Union(set.Generic()).List() {
list = append(list, resource.(T))
Expand Down

0 comments on commit c6dd2c9

Please sign in to comment.