Skip to content

Commit

Permalink
Bypass the caching of constraint templates
Browse files Browse the repository at this point in the history
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 <mprahl@users.noreply.github.com>
  • Loading branch information
mprahl authored and openshift-merge-bot[bot] committed Apr 22, 2024
1 parent 64304d4 commit a74d55e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@ func getManager(

options.LeaderElectionID = "governance-policy-framework-addon.open-cluster-management.io"
options.HealthProbeBindAddress = healthAddr
options.Client = client.Options{
Cache: &client.CacheOptions{
DisableFor: []client.Object{
&gktemplatesv1.ConstraintTemplate{},
&gktemplatesv1beta1.ConstraintTemplate{},
},
},
}
options.Cache = cache.Options{
ByObject: map[client.Object]cache.ByObject{
&extensionsv1.CustomResourceDefinition{}: {
Expand Down

0 comments on commit a74d55e

Please sign in to comment.