Skip to content

Commit f29ae6d

Browse files
committed
put mutex around installplan creation
Signed-off-by: akihikokuroda <[email protected]>
1 parent 20a4381 commit f29ae6d

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)
@@ -1162,6 +1163,9 @@ func (o *Operator) ensureInstallPlan(logger *logrus.Entry, namespace string, gen
11621163
return nil, err
11631164
}
11641165

1166+
o.muInstallPlan.Lock()
1167+
defer o.muInstallPlan.Unlock()
1168+
11651169
for _, installPlan := range installPlans {
11661170
if installPlan.Spec.Generation == gen {
11671171
return reference.GetReference(installPlan)

0 commit comments

Comments
 (0)