##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
##### SUMMARY
Added configuration in resource_config.yaml for limiting kubectl commands as per the discussion given in ticket 183
The configuration added is used in
slack.go and mattermost.go to pass it to executor.go and used to limit the commands execution
Fixes#183
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Feature Pull Request
##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
This Commit,
- Adds `kubectl.Enabled`, `Kubectl.DefaultNamespace` to `Config.Settings` to configure default namespace, under which all botkube kubectl commands will be executed by default.
- changes `Settings.RestrictAccess` into `Settings. Kubectl.RestrictAccess`
- updates all config.yaml files
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
<!--- Please list dependencies added with your change also -->
Fixes#176
**Preview**:
```yaml
settings:
# Kubectl executor configs
kubectl:
# Set true to enable kubectl commands execution
enabled: false
# set Namespace to execute botkube kubectl commands by default
defaultNamespace: default
# Set true to enable commands execution from configured channel only
restrictAccess: false
```
Signed-off-by: Mahendra Bagul <bagulm123@gmail.com>
Fixed https://github.com/infracloudio/botkube/pull/238#discussion_r361931721 issue. Removed msg and re-added the check required for not responding to non-kubectl commands
Signed-off-by: Mahendra Bagul <bagulm123@gmail.com>
Fixed a test case
Signed-off-by: Mahendra Bagul <bagulm123@gmail.com>
Fixed https://github.com/infracloudio/botkube/pull/238#discussion_r361931721 issue. Removed msg and re-added the check required for not responding to non-kubectl commands
Signed-off-by: Mahendra Bagul <bagulm123@gmail.com>
Placed the condition at right place.
Signed-off-by: Mahendra Bagul <bagulm123@gmail.com>
* Update comment to indicate the certificate is used by Mattermost
* Lint all-in-one deployment yamls
* Add pod security policy so botkube works in restricted clusters
* Fix helm/botkube/values.yaml clusterrolebinding namespace info
* Fix namespace format for clusterrole res in config
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
This commit,
- Adds support for event notifications through `Wehbook`
- updates configs in all yaml files
- updated helm charts
- adds unit tests for webhook notifier
- adds integration test webhook notifier
- adds test/webhook package to enable integration testing.
This Commit,
- runs botkube containers as Non Privileged user
- adds `securityContext` filed to containers in all yaml files.
- adds `securityContext` fields to helm charts
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()
* Include Namespace field only for Namespaced event notifs
This Commit
- includes namespace field only for namespaced objects notifs
- excludes namespace field from namespace independent resource events
* Enhance Update Event Notifications
This Commit,
- enhances update event notifications with details of what Spec is getting changed
- adds custom `SpecDiffReporter` and `utils.Diff()` method.
- adds update events in all config.yaml files
- adds unit-test for utils.Diff()
- adds update events for Deployment, Statefulset and Job by default.
This commit,
- enables sending short/long event notifications to channels
- adds a optional filed "notiftype" under channel config to change between short (default) and long notif types
- adds Message() method to event object for creating brief messages (to use across handlers)
- BugFix: enable/disable recommendations through config file