Skip to content

Commit

Permalink
Add support for ignoring namespaces
Browse files Browse the repository at this point in the history
This Commit,
- adds support for ignoring certain namespaces while watching all namespaces using `IgnoreNamespaceChecker`
- replaces `Namespaces []string` with `Namespaces.Include []string`
- adds `Namespaces.Ignore []string` ( optional / omitempty ) filed to ignore namespaces when Namespaces.Inculde contains "all"
- adds unit test cases for isNamespaceIgnored()
  • Loading branch information
codenio committed Aug 17, 2019
1 parent 72f2f19 commit baf1fa9
Show file tree
Hide file tree
Showing 9 changed files with 378 additions and 77 deletions.
90 changes: 71 additions & 19 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,121 +1,173 @@
## Resources you want to watch
resources:
- name: pod # Name of the resources e.g pod, deployment, ingress, etc.
namespaces: # List of namespaces, "all" will watch all the namespaces
- all
events: # List of lifecycle events you want to receive, e.g create, update, delete, error OR all
namespaces: # List of namespaces, "all" will watch all the namespaces
include:
- all
ignore: # List of namespaces to be ignored (omitempty), used only with include: all
- # example : include [all], ignore [x,y,z]
events: # List of lifecycle events you want to receive, e.g create, update, delete, error OR all
- create
- delete
- error
- name: service
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: deployment
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- update
- error
- name: statefulset
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: ingress
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: node
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: namespace
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: persistentvolume
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: persistentvolumeclaim
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: secret
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: configmap
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: daemonset
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: job
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- update
- name: role
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: rolebinding
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: clusterrolebindings
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: clusterrolebinding
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
Expand Down
86 changes: 67 additions & 19 deletions deploy-all-in-one-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,108 +10,153 @@ data:
config.yaml: |
## Resources you want to watch
resources:
- name: pod # Name of the resources e.g pod, deployment, ingress, etc. (Resource name must be in singular form)
namespaces: # List of namespaces, "all" will watch all the namespaces
- all
events: # List of lifecycle events you want to receive, e.g create, update, delete OR all
namespaces:
include:
- all
ignore: # List of namespaces to be ignored (omitempty), used only with include: all
- # example : include [all], ignore [x,y,z]
events: # List of lifecycle events you want to receive, e.g create, update, delete, error OR all
- create
- delete
- error
- name: service
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: deployment
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: statefulset
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: ingress
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: node
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: namespace
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: persistentvolume
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: persistentvolumeclaim
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: secret
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: configmap
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: daemonset
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- update
- error
- name: job
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- update
- delete
- error
- name: role
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
- error
- name: rolebinding
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
Expand All @@ -125,7 +170,10 @@ data:
- error
- name: clusterrolebinding
namespaces:
- all
include:
- all
ignore:
-
events:
- create
- delete
Expand Down
Loading

0 comments on commit baf1fa9

Please sign in to comment.