Skip to content

Commit

Permalink
fix: only watch auth related resources on generation change
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakknutsen committed Sep 4, 2024
1 parent bb839d0 commit 78a6003
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/authzctrl/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/predicate"
)

const name = "authorization"
Expand Down Expand Up @@ -115,8 +116,8 @@ func (r *Controller) SetupWithManager(mgr ctrl.Manager) error {
Kind: r.protectedResource.ResourceReference.Kind,
},
}, builder.OnlyMetadata).
Owns(&authorinov1beta2.AuthConfig{}).
Owns(&istiosecurityv1beta1.AuthorizationPolicy{}).
Owns(&authorinov1beta2.AuthConfig{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})).
Owns(&istiosecurityv1beta1.AuthorizationPolicy{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})).
Complete(r)
}

Expand Down

0 comments on commit 78a6003

Please sign in to comment.