Skip to content

Commit 7b0a05b

Browse files
committed
put mutex around installplan creation
Signed-off-by: akihikokuroda <[email protected]>
1 parent a07e3cc commit 7b0a05b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: pkg/controller/operators/catalog/operator.go

+4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ type Operator struct {
116116
installPlanTimeout time.Duration
117117
bundleUnpackTimeout time.Duration
118118
clientFactory clients.Factory
119+
muInstallPlan sync.Mutex
119120
}
120121

121122
type CatalogSourceSyncFunc func(logger *logrus.Entry, in *v1alpha1.CatalogSource) (out *v1alpha1.CatalogSource, continueSync bool, syncError error)
@@ -1167,6 +1168,9 @@ func (o *Operator) ensureInstallPlan(logger *logrus.Entry, namespace string, gen
11671168
return nil, err
11681169
}
11691170

1171+
o.muInstallPlan.Lock()
1172+
defer o.muInstallPlan.Unlock()
1173+
11701174
for _, installPlan := range installPlans {
11711175
if installPlan.Spec.Generation == gen {
11721176
return reference.GetReference(installPlan)

0 commit comments

Comments
 (0)