Skip to content

Commit a74d55e

Browse files
mprahlopenshift-merge-bot[bot]
authored andcommitted
Bypass the caching of constraint templates
Since the controller no longer restarts when the Gatekeeper installation state changes, we need to prevent controller-runtime from creating a watch on constraint templates, or else the client-go watcher will continuously log errors trying to restart the watch. Signed-off-by: mprahl <[email protected]>
1 parent 64304d4 commit a74d55e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,14 @@ func getManager(
484484

485485
options.LeaderElectionID = "governance-policy-framework-addon.open-cluster-management.io"
486486
options.HealthProbeBindAddress = healthAddr
487+
options.Client = client.Options{
488+
Cache: &client.CacheOptions{
489+
DisableFor: []client.Object{
490+
&gktemplatesv1.ConstraintTemplate{},
491+
&gktemplatesv1beta1.ConstraintTemplate{},
492+
},
493+
},
494+
}
487495
options.Cache = cache.Options{
488496
ByObject: map[client.Object]cache.ByObject{
489497
&extensionsv1.CustomResourceDefinition{}: {

0 commit comments

Comments
 (0)