Skip to content

Commit 2445f40

Browse files
timflannagandinhxuanvu
authored andcommitted
pkg/controller: Migrate to using a read lock instead of a readwrite lock when checking for any namespace caching errors (#2382)
Signed-off-by: timflannagan <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 396b5461555c2498507b1fff20fccc3e7ae15420
1 parent 4f7bf45 commit 2445f40

File tree

1 file changed

+2
-2
lines changed
  • staging/operator-lifecycle-manager/pkg/controller/registry/resolver/cache

1 file changed

+2
-2
lines changed

staging/operator-lifecycle-manager/pkg/controller/registry/resolver/cache/cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ type NamespacedOperatorCache struct {
136136
func (c *NamespacedOperatorCache) Error() error {
137137
var errs []error
138138
for key, snapshot := range c.snapshots {
139-
snapshot.m.Lock()
139+
snapshot.m.RLock()
140140
err := snapshot.err
141-
snapshot.m.Unlock()
141+
snapshot.m.RUnlock()
142142
if err != nil {
143143
errs = append(errs, fmt.Errorf("error using catalog %s (in namespace %s): %w", key.Name, key.Namespace, err))
144144
}

0 commit comments

Comments
 (0)