Skip to content

Commit

Permalink
Limit the OperatorPolicy watches to the managed cluster namespace
Browse files Browse the repository at this point in the history
Always having a clusterwide watch is incompatible with hosted mode and
does not match ConfigurationPolicy.

Related:
https://issues.redhat.com/browse/ACM-11952

Signed-off-by: mprahl <mprahl@users.noreply.github.com>
  • Loading branch information
mprahl committed May 31, 2024
1 parent 3a75ad9 commit 319f92d
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 80 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ func main() {
"metadata.namespace": watchNamespace,
}),
}
cacheByObject[&policyv1beta1.OperatorPolicy{}] = cache.ByObject{
Field: fields.SelectorFromSet(fields.Set{
"metadata.namespace": watchNamespace,
}),
}
} else {
log.Info("Skipping restrictions on the ConfigurationPolicy cache because watchNamespace is empty")
}
Expand Down
Loading

0 comments on commit 319f92d

Please sign in to comment.