Skip to content

Commit bd4ee1d

Browse files
Skip resource FE reconciler if CRD not present (#85)
Issue #, if available: aws-controllers-k8s/community#1287 Description of changes: Skips creating the FE reconciler for AWS resources if the field export CRD is not present in the cluster By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 360e72a commit bd4ee1d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pkg/runtime/service_controller.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,16 @@ func (c *serviceController) BindControllerManager(mgr ctrlrt.Manager, cfg ackcfg
243243
if err := rec.BindControllerManager(mgr); err != nil {
244244
return err
245245
}
246-
rd := rmf.ResourceDescriptor()
247-
feRec := NewFieldExportReconcilerForAWSResource(c, exporterLogger, cfg, c.metrics, cache, rd)
248-
if err := feRec.BindControllerManager(mgr); err != nil {
249-
return err
250-
}
251246
c.reconcilers = append(c.reconcilers, rec)
252-
c.resourceFieldExportReconcilers = append(c.resourceFieldExportReconcilers, feRec)
247+
248+
if exporterInstalled {
249+
rd := rmf.ResourceDescriptor()
250+
feRec := NewFieldExportReconcilerForAWSResource(c, exporterLogger, cfg, c.metrics, cache, rd)
251+
if err := feRec.BindControllerManager(mgr); err != nil {
252+
return err
253+
}
254+
c.resourceFieldExportReconcilers = append(c.resourceFieldExportReconcilers, feRec)
255+
}
253256
}
254257

255258
return nil

0 commit comments

Comments
 (0)