File tree 1 file changed +4
-0
lines changed
pkg/controller/registry/reconciler
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ package reconciler
4
4
import (
5
5
"context"
6
6
"fmt"
7
+ "sync"
7
8
8
9
"github.com/pkg/errors"
9
10
"github.com/sirupsen/logrus"
@@ -166,6 +167,7 @@ type ConfigMapRegistryReconciler struct {
166
167
Lister operatorlister.OperatorLister
167
168
OpClient operatorclient.ClientInterface
168
169
Image string
170
+ MuPod sync.RWMutex
169
171
}
170
172
171
173
var _ RegistryEnsurer = & ConfigMapRegistryReconciler {}
@@ -354,6 +356,8 @@ func (c *ConfigMapRegistryReconciler) ensureRoleBinding(source configMapCatalogS
354
356
355
357
func (c * ConfigMapRegistryReconciler ) ensurePod (source configMapCatalogSourceDecorator , overwrite bool ) error {
356
358
pod := source .Pod (c .Image )
359
+ c .MuPod .Lock ()
360
+ defer c .MuPod .Unlock ()
357
361
currentPods := c .currentPods (source , c .Image )
358
362
if len (currentPods ) > 0 {
359
363
if ! overwrite {
You can’t perform that action at this time.
0 commit comments