File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ type NamespaceCache struct {
5656
5757 log logr.Logger
5858 // Provide a namespace specifically to listen to.
59- // Provide empty string to listen to all namespaces.
59+ // Provide empty string to listen to all namespaces except kube-system and kube-public .
6060 listenNamespace string
6161
6262 // Namespace informer
@@ -88,15 +88,10 @@ func isListenNamespace(raw interface{}, listenNamespace string) bool {
8888 return false
8989 }
9090
91- if listenNamespace == object .ObjectMeta .Name {
92- return true
93- } else if object .ObjectMeta .Name == "kube-system" || object .ObjectMeta .Name == "kube-public" {
94- return false
95- } else if listenNamespace == "" {
96- return true
91+ if listenNamespace != "" {
92+ return listenNamespace == object .ObjectMeta .Name
9793 }
98-
99- return false
94+ return object .ObjectMeta .Name != "kube-system" && object .ObjectMeta .Name != "kube-public"
10095}
10196
10297// Run adds event handler functions to the SharedInformer and
You can’t perform that action at this time.
0 commit comments