Skip to content

Commit 2ab375a

Browse files
Merge pull request #1888 from exdx/fix/scoped-install
Bug 1913085: use OLM client when installing CRDs
2 parents 4a9d02b + 35a054e commit 2ab375a

File tree

2 files changed

+475
-1
lines changed

2 files changed

+475
-1
lines changed

pkg/controller/operators/catalog/operator.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,16 @@ func (o *Operator) ExecutePlan(plan *v1alpha1.InstallPlan) error {
15781578

15791579
ensurer := newStepEnsurer(kubeclient, crclient, dynamicClient)
15801580
r := newManifestResolver(plan.GetNamespace(), o.lister.CoreV1().ConfigMapLister(), o.logger)
1581-
b := newBuilder(kubeclient, dynamicClient, o.csvProvidedAPIsIndexer, r, o.logger)
1581+
1582+
// CRDs should be installed via the default OLM (cluster-admin) client and not the scoped client specified by the AttenuatedServiceAccount
1583+
// the StepBuilder is currently only implemented for CRD types
1584+
// TODO give the StepBuilder both OLM and scoped clients when it supports new scoped types
1585+
builderKubeClient, _, builderDynamicClient, err := o.clientAttenuator.AttenuateClientWithServiceAccount(nil)
1586+
if err != nil {
1587+
o.logger.Errorf("failed to get a client for plan execution- %v", err)
1588+
return err
1589+
}
1590+
b := newBuilder(builderKubeClient, builderDynamicClient, o.csvProvidedAPIsIndexer, r, o.logger)
15821591

15831592
for i, step := range plan.Status.Plan {
15841593
doStep := true

0 commit comments

Comments
 (0)